Skip to content

Commit

Permalink
♻️ Fix TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
xgouchet committed Dec 2, 2019
1 parent 2a567a1 commit 200029d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
2 changes: 0 additions & 2 deletions core/src/main/kotlin/fr/xgouchet/elmyr/Forge.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import kotlin.math.sqrt

/**
* The base class to generate forgeries.
*
* TODO include examples of all that's possible
*/
@Suppress("TooManyFunctions", "MethodOverloading")
open class Forge {
Expand Down
2 changes: 1 addition & 1 deletion core/src/test/kotlin/fr/xgouchet/elmyr/ForgeBooleanSpek.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ForgeBooleanSpek : Spek({
}

it("forges random boolean with probability") {
val probability = 0.13f // TODO random
val probability = forge.aFloat(0f, 1f)
verifyProbability(probability) { forge.aBool(probability) }
}
}
Expand Down
10 changes: 5 additions & 5 deletions core/src/test/kotlin/fr/xgouchet/elmyr/ForgeDelegateSpek.kt
Original file line number Diff line number Diff line change
Expand Up @@ -35,31 +35,31 @@ class ForgeDelegateSpek : Spek({
context("in a class with nullable properties") {

it("forges a nullable instance") {
val probability = 0.13f // TODO random
val probability = forge.aFloat(0f, 1f)
verifyProbability(expectedProbability = probability) {
val temp = WithNullable(forge, probability)
temp.forgedNullableBoolean == null
}
}

it("forges a nullable instance with default probability") {
val probability = 0.13f // TODO random
val probability = forge.aFloat(0f, 1f)
verifyProbability(expectedProbability = Forge.HALF_PROBABILITY) {
val temp = WithNullable(forge, probability)
temp.forgedNullableBooleanHalf == null
}
}

it("forges a nullable instance from Lambda") {
val probability = 0.13f // TODO random
val probability = forge.aFloat(0f, 1f)
verifyProbability(expectedProbability = probability) {
val temp = WithNullable(forge, probability)
temp.forgedNullableInt == null
}
}

it("forges a nullable instance from Lambda with default probability") {
val probability = 0.13f // TODO random
val probability = forge.aFloat(0f, 1f)
verifyProbability(expectedProbability = Forge.HALF_PROBABILITY) {
val temp = WithNullable(forge, probability)
temp.forgedNullableIntHalf == null
Expand All @@ -70,7 +70,7 @@ class ForgeDelegateSpek : Spek({
context("in a class with boolean properties") {

it("forges a boolean instance") {
val probability = 0.13f // TODO random
val probability = forge.aFloat(0f, 1f)
verifyProbability(
expectedProbability = probability
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class MockParameterContext(
) : ParameterContext {

override fun <A : Annotation?> findRepeatableAnnotations(annotationType: Class<A>?): MutableList<A> {
TODO("not implemented") // To change body of created functions use File | Settings | File Templates.
return mutableListOf()
}

override fun <A : Annotation?> findAnnotation(annotationType: Class<A>?): Optional<A> {
Expand All @@ -28,7 +28,7 @@ class MockParameterContext(
}

override fun getTarget(): Optional<Any> {
TODO("not implemented") // To change body of created functions use File | Settings | File Templates.
return Optional.empty()
}

override fun isAnnotated(annotationType: Class<out Annotation>?): Boolean {
Expand Down

0 comments on commit 200029d

Please sign in to comment.