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"); }
public void AllItemsSatisfyCondition_Null_Predicate_Throws_Exception() { IList <int> list = new List <int>() { 1, 2, 3, 4, 5 }; Insist.AllItemsSatisfyCondition(list, null, "list"); }
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)); } }
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); } }
public void AllItemsSatisfyCondition_Empty_Collection_Does_Not_Throw_Exception() { IList <int> list = new List <int>(); Insist.AllItemsSatisfyCondition(list, (i) => { return(i > 0); }, "list"); }
public void AllItemsSatisfyCondition_Null_Collection_Throws_Exception() { IList <int> list = null; Insist.AllItemsSatisfyCondition(list, (i) => { return(i > 0); }, "list"); }