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"); }
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"); }
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)); } }
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); } }
public void ContainsAtMost_Number_Of_Items_Less_Than_Zero_Throws_Exception() { List <string> list = new List <string>(); Insist.ContainsAtMost(list, -1, "list"); }
public void ContainsAtMost_Null_Collection_Throws_Exception() { List <string> list = null; Insist.ContainsAtMost(list, 1, "list"); }