public void DataRepository_InvalidDeletion_DoesNotDecreaseCollectionSize() { //Arrange: Initialise a data repository MockSqlRepository collection = new MockSqlRepository(); int Collection_Size = collection.Count; //Act: a deletion is targeted for non existing entry collection.Delete(new MockDataUnit { key = 0, attrTwo = "Entry 1" }); //Assert: The size of the collection has not changed Assert.AreEqual(Collection_Size, collection.Count); }
public void DataRepository_ValidDeletion_DecreasesCollectionSize() { //Arrange: Initialise a data repository MockSqlRepository collection = new MockSqlRepository(); int Collection_Size = collection.Count; //Act: a deletion is targeted for existing entry collection.Delete(new MockDataUnit { key=0, attrTwo="Entry 0"}); //Assert: The size of the collection has decreased by one. Assert.AreEqual(Collection_Size-1, collection.Count); }