public void NullListParameterUsePredicate() { //Arrange var listOriginal = default(List <Int32>); var listToAdd = new List <Int32>(); //Act CollectionHelpers.AddRangeIfNotExists(listOriginal, (alreadyPresent, toAdd) => alreadyPresent == toAdd, listToAdd); //Assert Assert.Fail(); }
public void NullPredicateParameterUsePredicate() { //Arrange var listOriginal = new List <Int32>(); var listToAdd = new List <Int32>(); //Act CollectionHelpers.AddRangeIfNotExists(listOriginal, null, listToAdd); //Assert Assert.Fail(); }
public void NormalUsePredicate() { //Arrange var listOriginal = new List <Int32>(new[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }); var listToAdd = new List <Int32>(new[] { 1, 2, 3, 4, 5 }); const Int32 EXPECTED_COUNT = 10; //Act CollectionHelpers.AddRangeIfNotExists(listOriginal, (alreadyPresent, toAdd) => alreadyPresent == toAdd, listToAdd); //Assert Assert.AreEqual(EXPECTED_COUNT, listOriginal.Count); }