-
-
Notifications
You must be signed in to change notification settings - Fork 208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding CharSequenceToContainCheckerSamples.kt infix style #1558
Closed
Closed
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
94a6b18
Adding CharSequenceToContainCheckerSamples.kt infix style
rohitverma007 69c4ee2
Update apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/a…
codieai[bot] 58482aa
Merge pull request #8 from rohitverma007/issue-6-fix
rohitverma007 380b7c4
Update apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/a…
codieai[bot] 697f8ef
Update apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/a…
codieai[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
54 changes: 54 additions & 0 deletions
54
...t/kotlin/ch/tutteli/atrium/api/infix/en_GB/samples/CharSequenceToContainCheckerSamples.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,54 @@ | ||
package ch.tutteli.atrium.api.infix.en_GB.samples | ||
|
||
import ch.tutteli.atrium.api.infix.en_GB.* | ||
import ch.tutteli.atrium.api.verbs.expect | ||
import kotlin.test.Test | ||
|
||
class CharSequenceToContainCheckerSamples { | ||
|
||
@Test | ||
fun atLeast() { | ||
expect("ABBC") toContain o atLeast 2 value "B" | ||
|
||
fails { | ||
expect("ABB") toContain o atLeast 2 value "A" | ||
} | ||
} | ||
|
||
@Test | ||
fun atMost() { | ||
expect("ABBC") toContain o atMost 2 value "B" | ||
|
||
fails { | ||
expect("AABBAA") toContain o atMost 3 value "A" | ||
} | ||
} | ||
|
||
@Test | ||
fun notOrAtMost() { | ||
expect("ABBC") toContain o notOrAtMost 2 value "D" | ||
expect("ABBC") toContain o notOrAtMost 2 value "B" | ||
|
||
fails { | ||
expect("AABBAA") toContain o notOrAtMost 3 value "A" | ||
} | ||
} | ||
|
||
@Test | ||
fun butAtMost() { | ||
expect("ABBC") toContain o atLeast 1 butAtMost 2 value "B" | ||
|
||
fails { | ||
expect("ABBBBCD") toContain o atLeast 2 butAtMost 3 value "B" | ||
} | ||
} | ||
|
||
@Test | ||
fun exactly() { | ||
expect("ABCBAC") toContain o exactly 2 value "C" | ||
|
||
fails { | ||
expect("ABBBBCD") toContain o exactly 3 value "B" | ||
} | ||
} | ||
} |
88 changes: 88 additions & 0 deletions
88
...t/kotlin/ch/tutteli/atrium/api/infix/en_GB/samples/CharSequenceToContainCreatorSamples.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,88 @@ | ||
package ch.tutteli.atrium.api.infix.en_GB.samples | ||
|
||
import ch.tutteli.atrium.api.infix.en_GB.* | ||
import ch.tutteli.atrium.api.verbs.expect | ||
import kotlin.test.Test | ||
|
||
class CharSequenceToContainCreatorSamples { | ||
|
||
@Test | ||
fun value() { | ||
expect("ABC") toContain exactly(1).value("A") | ||
expect("ABBBC") toContain atLeast(2).value("B") | ||
|
||
fails { | ||
expect("AAAAAA") toContain atMost(3).value("A") | ||
} | ||
} | ||
|
||
@Test | ||
fun valueIgnoringCase() { | ||
expect("ABC") toContain ignoringCase value("a") | ||
expect("AbbbC") toContain ignoringCase value("B") | ||
|
||
fails { | ||
expect("AAAAAA") toContain ignoringCase value("B") | ||
} | ||
} | ||
|
||
@Test | ||
fun valueIgnoringCaseWithChecker() { | ||
expect("ABC") toContain ignoringCase exactly(1).value("A") | ||
expect("AAABBC") toContain ignoringCase atMost(3).value("b") | ||
expect("aBBBCD") toContain ignoringCase atLeast(1).value("A") | ||
|
||
fails { | ||
expect("AAAAAABBBB") toContain ignoringCase atMost(3).value("A") | ||
} | ||
fails { | ||
expect("AAABBBb") toContain ignoringCase exactly(3).value("b") | ||
} | ||
fails { | ||
expect("AAAAAABBBB") toContain ignoringCase atLeast(3).value("D") | ||
} | ||
} | ||
|
||
@Test | ||
fun values() { | ||
expect("ABC") toContain exactly(1).values("A", "B", "C") | ||
expect("AAABC") toContain atMost(3).values("A", "B", "C") | ||
expect("ABBBCD") toContain atLeast(1).values("A", "B", "C", "D") | ||
|
||
fails { | ||
expect("AAAAAABBBB") toContain atMost(3).values("A", "B") | ||
} | ||
fails { | ||
expect("AAABBBB") toContain exactly(3).values("A", "B") | ||
} | ||
fails { | ||
expect("AAAAAABBBB") toContain atLeast(3).values("A", "B", "C") | ||
} | ||
} | ||
|
||
@Test | ||
fun valuesIgnoringCase() { | ||
expect("AbC") toContain ignoringCase values("A", "B", "c") | ||
|
||
fails { | ||
expect("aabaabbb") toContain ignoringCase values("A", "B", "C") | ||
} | ||
} | ||
|
||
@Test | ||
fun valuesIgnoringCaseWithChecker() { | ||
expect("ABc") toContain ignoringCase exactly(1).values("A", "b", "C") | ||
expect("AaaBC") toContain ignoringCase atMost(3).values("A", "B", "c") | ||
expect("ABBBcD") toContain ignoringCase atLeast(1).values("a", "b", "C", "d") | ||
|
||
fails { | ||
expect("AAAAAABBBB") toContain ignoringCase atMost(3).values("a", "b") | ||
} | ||
fails { | ||
expect("AAABBBB") toContain ignoringCase exactly(3).values("A", "b") | ||
} | ||
fails { | ||
expect("AAAAAABBBB") toContain ignoringCase atLeast(3).values("a", "b", "C") | ||
} | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
.../ch/tutteli/atrium/api/infix/en_GB/samples/CharSequenceToContainSearchBehaviourSamples.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,18 @@ | ||
package ch.tutteli.atrium.api.infix.en_GB.samples | ||
|
||
import ch.tutteli.atrium.api.infix.en_GB.* | ||
import ch.tutteli.atrium.api.verbs.expect | ||
import kotlin.test.Test | ||
|
||
class CharSequenceToContainSearchBehaviourSamples { | ||
|
||
@Test | ||
fun ignoringCase() { | ||
expect("ABC") containsIgnoringCase exactly 1 value "a" | ||
expect("ABbC") containsIgnoringCase atLeast 2 value "b" | ||
|
||
fails { | ||
expect("AAAaaa") containsIgnoringCase atMost 3 value "a" | ||
} | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only half infix 🙂 (I guess this does not compile or does it?)
More things to fix also further below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed