public void ThenTInTOut_WhenTryFailed_ReturnsOriginalError() { TryResult <int> t = "err"; var t2 = t.Then(r => 1); Assert.AreEqual(t.ErrorMessage, t2.ErrorMessage); }
public void ThenTIn_WhenTryFailed_ReturnsOriginalError() { TryResult <int> t = "err"; var t2 = t.Then(() => { }); Assert.AreEqual(t, t2); }
public void ThenTIn_WhenTryFailed_DoesNotExecute() { TryResult <int> t = "err"; var executed = false; t.Then(() => { executed = true; }); Assert.IsFalse(executed); }
public void ThenTIn_WhenTrySucceeded_Executes() { TryResult <int> t = 1; var executed = false; t.Then(() => { executed = true; }); Assert.IsTrue(executed); }
public void ThenTOut_WhenTryFailed_DoesNotExecute() { TryResult t = "err"; var executed = false; t.Then(() => { executed = true; return(1); }); Assert.IsFalse(executed); }
public void ThenTInTOut_WhenTryResultIsNull_ThrowsArgumentNullException() { TryResult <int> t = null; Assert.Throws <ArgumentNullException>(() => t.Then(r => 1)); }
public void ThenTInTOut_WhenExecuteIsNull_ThrowsArgumentNullException() { TryResult <int> t = ""; Assert.Throws <ArgumentNullException>(() => t.Then <int, int>(null)); }
public void ThenTIn_WhenTryResultIsNull_ThrowsArgumentNullException() { TryResult <int> t = null; Assert.Throws <ArgumentNullException>(() => t.Then(() => string.Empty)); }
public void Then_WhenExecuteIsNull_ThrowsArgumentNullException() { TryResult t = ""; Assert.Throws <ArgumentNullException>(() => t.Then(null)); }