-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: add tests for FeaturesInDevelopmentDefaultsBuilder
- Loading branch information
Showing
1 changed file
with
62 additions
and
0 deletions.
There are no files selected for viewing
62 changes: 62 additions & 0 deletions
62
...c/test/kotlin/org/wordpress/android/processor/FeaturesInDevelopmentDefaultsBuilderTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
package org.wordpress.android.processor | ||
|
||
import org.assertj.core.api.Assertions | ||
import org.junit.Test | ||
|
||
class FeaturesInDevelopmentDefaultsBuilderTest { | ||
@Test | ||
fun `given a list of features in development, when building the object, then generate list of features in development`() { | ||
// given | ||
val featureA = "valueA" | ||
val featureB = "valueB" | ||
val features = listOf(featureA, featureB) | ||
|
||
// when | ||
val sut = FeaturesInDevelopmentDefaultsBuilder(features) | ||
|
||
// then | ||
Assertions.assertThat(sut.getContent().toString()).isEqualTo( | ||
""" | ||
// Automatically generated file. DO NOT MODIFY | ||
package org.wordpress.android.util.config | ||
import kotlin.String | ||
import kotlin.collections.List | ||
object FeaturesInDevelopment { | ||
val featuresInDevelopment: List<String> = listOf( | ||
"$featureA", | ||
"$featureB" | ||
) | ||
} | ||
""".trimIndent() | ||
) | ||
} | ||
|
||
@Test | ||
fun `given an empty list of features in development, when building the object, then generate empty list of features in development`() { | ||
// given | ||
val features = emptyList<String>() | ||
|
||
// when | ||
val sut = FeaturesInDevelopmentDefaultsBuilder(features) | ||
|
||
// then | ||
Assertions.assertThat(sut.getContent().toString()).isEqualTo( | ||
""" | ||
// Automatically generated file. DO NOT MODIFY | ||
package org.wordpress.android.util.config | ||
import kotlin.String | ||
import kotlin.collections.List | ||
object FeaturesInDevelopment { | ||
val featuresInDevelopment: List<String> = listOf( | ||
) | ||
} | ||
""".trimIndent() | ||
) | ||
} | ||
} |