Exemplo n.º 1
0
 public void Matching_Where_on_Success_returns_Success()
 {
     var success = new Success<int>(42);
     var where = success.Where(x => x > 10);
     Assert.IsTrue(where.IsSuccess);
     Assert.AreEqual(42, where.Value);
 }
Exemplo n.º 2
0
 public void Non_matching_Where_on_Success_return_Failure()
 {
     var success = new Success<int>(42);
     var where = success.Where(x => x < 10);
     Assert.IsTrue(where.IsFailure);
     Assert.IsInstanceOfType(typeof(NoSuchElementException), where.Exception);
 }