public void Require_exception_uses_passed_message() { var errorMessage = "error"; var ex = Assert.Throws <ArgumentException>(() => Guards.Require(string.Empty, errorMessage)); Assert.Equal(errorMessage, ex.Message); }
public void Require_throws_when_null() { Assert.Throws <ArgumentException>(() => Guards.Require(null, "message")); }
public void Require_returns_invoker_to_allow_chaining_more_guards() { var result = Guards.Require(0, "message"); Assert.IsType <GuardInvoker>(result); }
public void Require_does_not_throws_when_number_zero() { Guards.Require(0, "message"); }
public void Require_does_not_throws_when_non_empty_string() { Guards.Require("hello", "message"); }
public void Require_throws_when_empty_string() { Assert.Throws <ArgumentException>(() => Guards.Require(string.Empty, "message")); }