public void ContainsShouldDoNothingWhenItemIsNotContained() { // Arrange var sut = new PipelineCache <string>(); var key = new CacheKey(1, 2); // Act var ex = Record.Exception(() => sut.Remove(key)); // Assert Assert.Null(ex); }
public void RemoveShouldRemoveItemFromCache() { // Arrange var sut = new PipelineCache <string>(); var key = new CacheKey(1, 2); sut.AddOrReplace(key, "hello world"); // Act var before = sut.Contains(key); sut.Remove(key); var after = sut.Contains(key); // Assert Assert.True(before); Assert.False(after); }