예제 #1
0
        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);
        }
예제 #2
0
 public void Require_throws_when_null()
 {
     Assert.Throws <ArgumentException>(() => Guards.Require(null, "message"));
 }
예제 #3
0
        public void Require_returns_invoker_to_allow_chaining_more_guards()
        {
            var result = Guards.Require(0, "message");

            Assert.IsType <GuardInvoker>(result);
        }
예제 #4
0
 public void Require_does_not_throws_when_number_zero()
 {
     Guards.Require(0, "message");
 }
예제 #5
0
 public void Require_does_not_throws_when_non_empty_string()
 {
     Guards.Require("hello", "message");
 }
예제 #6
0
 public void Require_throws_when_empty_string()
 {
     Assert.Throws <ArgumentException>(() => Guards.Require(string.Empty, "message"));
 }