Atrium: move size check out of Iterable.contains assertions

Created on 10 Jan 2020  路  11Comments  路  Source: robstoll/atrium

Platform (jvm, js, android): all
Extension (none, kotlin 1.3, jdk8): none

Code related feature

Discussion see #292 and https://github.com/robstoll/atrium-roadmap/issues/53

In short move the > size: 2 to be ... check out of contains..

help wanted

All 11 comments

I'll work on this

@ivanmiklec Let me know in case you need more information

@robstoll was busy but I'm going to solve this during the upcoming week

@ivanmiklec No worries, I don't expect it to be part of 0.13.0 so no rush.

@ivanmiklec I am going to refactor IterableContains, I suggest you wait with your implementation until #564 is closed. If you have already started: don't worry, the change will mainly be moving code from domain-robstoll to logic

Sure, going to wait a bit then

@ivanmiklec refactoring is merged, you need to modify the files in /logic/atrium-logic-common/src/main/kotlin/ch/tutteli/atrium/logic/creating/iterable/contains/creators/impl

Hey, just to check am I on a good path for this one and to pick up a few clues, found size check Assertion is being added in InAnyOrderOnlyAssertionCreator and InOrderOnlyBaseAssertionCreator. For now I removed it from there, don't know if that is Ok.

Writing from my mobile (without code at hand). I think the size checks should still be done in there but the resulting assertion at the end of the methods needs to re-arranged. First the size check and then contains.
Now... I remember that I have factored out some code into an abstract class. Might be that you need to make the adjustment there. Let me know if this already helps. Otherwise, I am going to look into the code at some point

Yeah thanks for elaborating, finally understood idea, found there is size assertions being added in kotlin/ch/tutteli/atrium/logic/creating/iterable/contains/creators/impl/InAnyOrderOnlyAssertionCreator.kt, still not kinda sure where to go with it

Line 57 ff. we create a feature assertion for size and add it to assertions => don't do this any more, instead we want to add the feature assertion on the same level as the summary assertion. I.e. assertionBuilder.invisibleGroup

Was this page helpful?
0 / 5 - 0 ratings

Related issues

robstoll picture robstoll  路  4Comments

robstoll picture robstoll  路  6Comments

robstoll picture robstoll  路  6Comments

robstoll picture robstoll  路  3Comments

robstoll picture robstoll  路  6Comments