public void ShouldAddSingleItem() { // Arrange var objectToAdd = new AlphaValidator { Key = "AlphaOnly" }; // Act var collection = new ValidatorCollection { objectToAdd }; // Assert collection.ShouldContain(objectToAdd); }
public void ShouldAddRangeOfItems() { // Arrange IEnumerable <IValidator> objectsToAdd = new List <IValidator> { new AlphaValidator { Key = "AlphaOnly" }, new RequiredValidator { Key = "Required" }, }; var collection = new ValidatorCollection(); // Act collection.AddRange(objectsToAdd); // Assert foreach (IValidator item in objectsToAdd) { collection.ShouldContain(item); } }