Exemplo n.º 1
0
        public void Guard_argument_shouldnt_be_null()
        {
            Assert.DoesNotThrow(
                () => Is.NotNull(string.Empty, ""));

            string val = null;

            Assert.Throws <ArgumentNullException>(
                () => Is.NotNull(val, ""));
        }
Exemplo n.º 2
0
        public void Guard_argument_shouldnt_be_null_or_empty()
        {
            Assert.Throws <ArgumentException>(
                () => Is.NotNullOrEmpty("", "param"));

            Assert.Throws <ArgumentException>(
                () => Is.NotNullOrEmpty(null, "param"));

            Assert.DoesNotThrow(
                () => Is.NotNullOrEmpty("value", "param"));
        }
Exemplo n.º 3
0
 public void Guard_defends_is_passing_through()
 {
     Assert.DoesNotThrow(
         () => Is.Not(false)
         .Throw <ArgumentException>("This is Guard Testing"));
 }
Exemplo n.º 4
0
 public void Guard_defends()
 {
     Assert.Throws <ArgumentException>(
         () => Is.Not(true)
         .Throw <ArgumentException>("This is Guard Testing"));
 }