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
object RegistrationTest : Spek({ | |
group("registration") { | |
beforeGroup { println("beforeGroup : registration") } | |
beforeEachTest { println("beforeEachTest : root") } | |
test("should initialize with default values") { println("test1") } | |
group("success") { | |
beforeEachTest { println("beforeEachTest : success") } |
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
object RegistrationTest : Spek({ | |
group("registration") { | |
beforeGroup { println("beforeGroup : registration") } | |
test("should initialize with default values") { println("test1") } | |
group("success") { | |
beforeEachTest { println("beforeEachTest : success") } | |
test("should proceed to next screen") { println("test2") } |
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
object RegistrationTest : Spek({ | |
group("registration") { | |
println("registration") | |
test("should initialize with default values") { println("test1") } | |
group("success") { | |
println("success") | |
test("should proceed to next screen") { println("test2") } |
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
object BitCoinPriceRepositoryTest : Spek({ | |
val pricesWrapperDtoMock = PricesWrapperDto.newMock() | |
val pricesMock = Prices.newMock() | |
val pricesMapper = PricesMapper() | |
val mappedValuesFromApi = pricesMapper.map(pricesWrapperDtoMock) | |
val refreshObserver by memoized { TestObserver.create<Void>() } | |
val remoteSource by memoized { mock(BitCoinRemoteSource::class.java) } |
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
val mock by memoized(CachingMode.WE_CHANGE_THIS_ONE) { mock(Repository::class.java) } | |
beforeGroup { println("beforeGroup \t mock : $mock") } | |
beforeEachTest { println("beforeEachTest \t mock : $mock") } | |
group("A") { | |
test("test 1") { println("test 1 \t\t\t mock : $mock") } | |
} | |
group("B") { |
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
/** | |
* Specifies how [lifecycle aware objects][MemoizedValue] are cached. | |
*/ | |
enum class CachingMode { | |
/** | |
* Each group will get their own unique instance. Nested groups will have | |
* their own unique instance as well. | |
*/ | |
GROUP, |
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
val dynamicExclude = if (!BuildConfig.DEBUG) Skip.No else Skip.Yes("reason here") | |
describe("registration", skip = dynamicExclude) { | |
it("should stop refreshing") {} | |
} | |
describe("log in") { | |
it("should report logs", skip = dynamicExclude) {} | |
it("should stop refreshing") {} |
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
enum class TRANSFORMER { FIRST, SECOND, THIRD, OTHER } | |
fun transform(input: Int) : TRANSFORMER { | |
return when (input) { | |
1 -> FIRST | |
2 -> SECOND | |
3 -> THIRD | |
else -> OTHER | |
} |
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
describe("fetch user data") { | |
val repository by memoized { mock(Repository::class.java)} | |
val service by memoized { Service(repository)} | |
context("the data is fetched successfuly") { | |
lateinit var result : List<SomeData> | |
val expectedResult = listOf(...) |
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
object HelloWorld : Spek({ | |
val mock by memoized { mock(Repository::class.java) } | |
group("A") { | |
group("B") { | |
test("test 1") { println("mock : $mock")} | |
test("test 2") { println("mock : $mock")} |
NewerOlder