Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

TracingStatusHelper unit test #114

Merged
merged 5 commits into from
Jun 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
package de.rki.coronawarnapp.util.formatter

import org.hamcrest.CoreMatchers.`is`
import org.hamcrest.MatcherAssert.assertThat
import org.junit.Test

class TracingStatusHelperTest {

@Test
fun testTracingActiveAllOn() {
val result = tracingStatusHelper(tracing = true, bluetooth = true, connection = true)
assertThat(result, `is`((TracingStatusHelper.TRACING_ACTIVE)))
}

@Test
fun testTracingInactiveWhenAllOff() {
val result = tracingStatusHelper(tracing = false, bluetooth = false, connection = false)
assertThat(result, `is`((TracingStatusHelper.TRACING_INACTIVE)))
}

@Test
fun testTracingInactiveWhenTracingOffBluetoothOffConnectionOn() {
val result = tracingStatusHelper(tracing = false, bluetooth = false, connection = true)
assertThat(result, `is`((TracingStatusHelper.TRACING_INACTIVE)))
}

@Test
fun testTracingInactiveWhenTracingOffBluetoothOnConnectionOff() {
val result = tracingStatusHelper(tracing = false, bluetooth = true, connection = false)
assertThat(result, `is`((TracingStatusHelper.TRACING_INACTIVE)))
}

@Test
fun testTracingInactiveWhenTracingOffBluetoothOnConnectionOn() {
val result = tracingStatusHelper(tracing = false, bluetooth = true, connection = true)
assertThat(result, `is`((TracingStatusHelper.TRACING_INACTIVE)))
}

@Test
fun testBluetoothInactiveWhenTracingOnBluetoothOffConnectionOn() {
val result = tracingStatusHelper(tracing = true, bluetooth = false, connection = true)
assertThat(result, `is`((TracingStatusHelper.BLUETOOTH)))
}

@Test
fun testBluetoothInactiveWhenTracingOnBluetoothOffConnectionOff() {
val result = tracingStatusHelper(tracing = true, bluetooth = false, connection = false)
assertThat(result, `is`((TracingStatusHelper.BLUETOOTH)))
}

@Test
fun testConnectionInactiveWhenTracingOnBluetoothOffConnectionOff() {
val result = tracingStatusHelper(tracing = true, bluetooth = true, connection = false)
assertThat(result, `is`((TracingStatusHelper.CONNECTION)))
}
}