Skip to content

Commit

Permalink
tests: add tests for FeaturesInDevelopmentDefaultsBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
wzieba committed Feb 20, 2024
1 parent db5bbc7 commit 18f368d
Showing 1 changed file with 62 additions and 0 deletions.
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()
)
}
}

0 comments on commit 18f368d

Please sign in to comment.