val shopName: String, val shopImageUrl: String, val shopCategory: String, ) { init { if (shopName.isBlank() || shopImageUrl.isBlank() || shopCategory.isBlank()) { throw DomainModelException(“ShopCopy items must not be Empty.”) } } }
shopName: String, val shopImageUrl: String, val shopCategory: String, ) { init { if (shopName.isBlank() || shopImageUrl.isBlank() || shopCategory.isBlank()) { throw DomainModelException(“ShopCopy items must not be Empty.”) } } }
result" { Calculator().add(2, 3) shouldBe 5 } "subtraction should return correct result" { Calculator().subtract(5, 3) shouldBe 2 } }) // test target class Calculator { fun add(a: Int, b: Int): Int = a + b fun subtract(a: Int, b: Int): Int = a - b }
the correct result when adding two numbers") { Calculator().add(2, 3) shouldBe 5 } should("return the correct result when subtracting two numbers") { Calculator().subtract(5, 3) shouldBe 2 } }) // test target class Calculator { fun add(a: Int, b: Int): Int = a + b fun subtract(a: Int, b: Int): Int = a - b }
{ `when`("adding two numbers") { then("it should return the correct result") { Calculator().add(2, 3) shouldBe 5 } } `when`("subtracting two numbers") { then("it should return the correct result") { Calculator().subtract(5, 3) shouldBe 2 } } } }) // test target class Calculator { fun add(a: Int, b: Int): Int = a + b fun subtract(a: Int, b: Int): Int = a - b }