This repository has been archived by the owner on Jan 3, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from Kshitij09/range-assertions
Added shouldNotBeInRange for ClosedRange #119
- Loading branch information
Showing
4 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
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
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
25 changes: 25 additions & 0 deletions
25
common/src/test/kotlin/org/amshove/kluent/collections/ShouldNotBeInRangeShould.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,25 @@ | ||
package org.amshove.kluent.collections | ||
|
||
import org.amshove.kluent.shouldNotBeInRange | ||
import kotlin.test.Test | ||
import kotlin.test.assertFails | ||
|
||
class ShouldNotBeInRangeShould { | ||
|
||
@Test | ||
fun passWhenAllElementsOfTheInputRangeAreNotInTheTargetRange() { | ||
val targetRange: IntRange = 1..9 | ||
val inputRange = 4..5 | ||
|
||
targetRange.shouldNotBeInRange(inputRange) | ||
} | ||
|
||
@Test | ||
fun failWhenAllElementsOfTheInputRangeAreInTheTargetRange() { | ||
val targetRange = 4..5 | ||
val inputRange = 1..9 | ||
|
||
assertFails { targetRange.shouldNotBeInRange(inputRange) } | ||
} | ||
|
||
} |
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