Esempio n. 1
0
 public void ItemNotFoundNoCompletion()
 {
     new [] { FT.left(1), FT.left(2), FT.left(3), FT.left(4) }.
     Select(Future.successful).addUnfulfilled().
     firstOfSuccessfulCollect().value.shouldEqual(F.none <Either <int[], string> >());
 }
Esempio n. 2
0
 public void ItemNotFound()
 {
     new [] { FT.left(1), FT.left(2), FT.left(3), FT.left(4) }.
     Select(Future.successful).firstOfSuccessfulCollect().value.get.
     leftValue.get.asString().shouldEqual(new[] { 1, 2, 3, 4 }.asString());
 }
Esempio n. 3
0
 public void MultipleItemsFound()
 {
     new [] { FT.left(1), FT.left(2), FT.right("a"), FT.left(3), FT.right("b") }.
     Select(Future.successful).firstOfSuccessfulCollect().value.get.
     shouldEqual(F.right <int[], string>("a"));
 }
Esempio n. 4
0
 public void RightNotFoundNoComplete()
 {
     new[] { FT.left(1), FT.left(3), FT.left(5), FT.left(7) }.
     Select(Future.successful).addUnfulfilled().firstOfSuccessful().
     value.shouldBeNone();
 }
Esempio n. 5
0
 public void RightNotFound()
 {
     new[] { FT.left(1), FT.left(3), FT.left(5), FT.left(7) }.
     Select(Future.successful).firstOfSuccessful().
     value.get.shouldBeNone();
 }
Esempio n. 6
0
 public void MultipleRightsFound()
 {
     new[] { FT.left(1), FT.left(3), FT.left(5), FT.right("6"), FT.left(7), FT.right("8") }.
     Select(Future.successful).firstOfSuccessful().
     value.get.shouldBeSome("6");
 }