public void ThrowIf_exception_uses_passed_error_message() { var errorMessage = "error"; var ex = Assert.Throws <ArgumentException>(() => Guards.ThrowIf(1 < 2, errorMessage)); Assert.Equal(errorMessage, ex.Message); }
public void ThrowIf_returns_invoker_to_allow_chaining_more_guards() { var result = Guards.ThrowIf(6 == 9, "message"); Assert.IsType <GuardInvoker>(result); }
public void ThrowIf_does_not_throw_when_conditioon_false() { Guards.ThrowIf(1 > 2, "message"); }
public void ThrowIf_throws_when_conditioon_true() { Assert.Throws <ArgumentException>(() => Guards.ThrowIf(1 < 2, "message")); }