Exemple #1
0
        public void AllItemsSatisfyCondition_Collection_Does_Not_Contain_Invalid_Value_Does_Not_Throw_Exception()
        {
            IList <int> list = new List <int>()
            {
                1, 2, 3, 4, 5
            };

            Insist.AllItemsSatisfyCondition(list, (i) => { return(i > 0); }, "list");
        }
Exemple #2
0
        public void AllItemsSatisfyCondition_Null_Predicate_Throws_Exception()
        {
            IList <int> list = new List <int>()
            {
                1, 2, 3, 4, 5
            };

            Insist.AllItemsSatisfyCondition(list, null, "list");
        }
Exemple #3
0
 public void AllItemsSatisfyCondition_Thrown_Exception_Has_Correct_Message()
 {
     try
     {
         IList <int> list = new List <int>()
         {
             1, 2, 3, 0, 4, 5
         };
         Insist.AllItemsSatisfyCondition(list, (i) => { return(i > 0); }, ARGUMENT_NAME, MESSAGE);
     }
     catch (ArgumentException ae)
     {
         Assert.IsTrue(ae.Message.Contains(MESSAGE));
     }
 }
Exemple #4
0
 public void AllItemsSatisfyCondition_Thrown_Exception_Has_Correct_Argument_Name()
 {
     try
     {
         IList <int> list = new List <int>()
         {
             1, 2, 3, 0, 4, 5
         };
         Insist.AllItemsSatisfyCondition(list, (i) => { return(i > 0); }, ARGUMENT_NAME);
     }
     catch (ArgumentException ae)
     {
         Assert.AreEqual(ARGUMENT_NAME, ae.ParamName);
     }
 }
Exemple #5
0
        public void AllItemsSatisfyCondition_Empty_Collection_Does_Not_Throw_Exception()
        {
            IList <int> list = new List <int>();

            Insist.AllItemsSatisfyCondition(list, (i) => { return(i > 0); }, "list");
        }
Exemple #6
0
        public void AllItemsSatisfyCondition_Null_Collection_Throws_Exception()
        {
            IList <int> list = null;

            Insist.AllItemsSatisfyCondition(list, (i) => { return(i > 0); }, "list");
        }