simon.vergauwen
10/13/2018, 9:45 AMsandjelkovic
10/13/2018, 9:52 AMsandjelkovic
10/13/2018, 9:54 AMsimon.vergauwen
10/13/2018, 9:55 AMOption#forall
or Option#exists
which checks the inner value with a Predicate<A>
simon.vergauwen
10/13/2018, 9:56 AMFoldable
so with the next release they will also be available for every time that does if they are missing atm.simon.vergauwen
10/13/2018, 9:58 AMFoldable
instance you can implement assertions based on Foldable
. i.e. fun Kind<F, A>.shouldBe(a: A, FF: Foldable<F>): Boolean = FF.run { this@shouldBe.exits { this == a} }
sandjelkovic
10/13/2018, 10:01 AMraulraja
10/13/2018, 12:21 PMsandjelkovic
10/13/2018, 3:01 PMval option = service.findByUUID(uuidString)
expectThat(option).isDefined {
get { uuid }.isEqualTo(uuidString)
get { name }.isEqualTo("Name")
}
Although not yet functional, it works like this for now, but I'm starting to like some of the suggestions better, especially the assertion library independent ones 🙂