Exemple #1
0
        public void ContainsAtMost_Number_Of_Items_Less_Than_Max_Does_Not_Throw_Exception()
        {
            List <string> list = new List <string>()
            {
                "a", "b", "c"
            };

            Insist.ContainsAtMost(list, 10, "list");
        }
Exemple #2
0
        public void ContainsAtMost_Number_Of_Items_More_Than_Max_Throws_Exception()
        {
            List <string> list = new List <string>()
            {
                "a", "b", "c"
            };

            Insist.ContainsAtMost(list, 2, "list");
        }
Exemple #3
0
 public void ContainsAtMost_Thrown_Exception_Has_Correct_Message()
 {
     try
     {
         IList <string> list = new List <string>()
         {
             "a", "b", "c"
         };
         Insist.ContainsAtMost(list, 1, ARGUMENT_NAME, MESSAGE);
     }
     catch (ArgumentException ae)
     {
         Assert.IsTrue(ae.Message.Contains(MESSAGE));
     }
 }
Exemple #4
0
 public void ContainsAtMost_Thrown_Exception_Has_Correct_Argument_Name()
 {
     try
     {
         IList <string> list = new List <string>()
         {
             "a", "b", "c"
         };
         Insist.ContainsAtMost(list, 1, ARGUMENT_NAME);
     }
     catch (ArgumentException ae)
     {
         Assert.AreEqual(ARGUMENT_NAME, ae.ParamName);
     }
 }
Exemple #5
0
        public void ContainsAtMost_Number_Of_Items_Less_Than_Zero_Throws_Exception()
        {
            List <string> list = new List <string>();

            Insist.ContainsAtMost(list, -1, "list");
        }
Exemple #6
0
        public void ContainsAtMost_Null_Collection_Throws_Exception()
        {
            List <string> list = null;

            Insist.ContainsAtMost(list, 1, "list");
        }