Example #1
0
 public void RecoverWith_on_Failure_does_call_closure()
 {
     var t = new Failure<string>(new Exception());
     Exception e = null;
     Func<Exception, Try<string>> c = ex => {
         e = ex;
         return new Success<string>("bar");
     };
     Assert.AreEqual("bar", t.RecoverWith(c).Value);
     Assert.AreSame(t.Exception, e);
 }