public void ShouldRetrieveFromFunc() { // Arrange ClassCacheSync <string> subject = new ClassCacheSync <string>(); // Act string actual = subject.Retrieve(() => "first-value"); // Assert actual.Should().Be("first-value"); }
public void ShouldRetrieveSecondAfterClear() { // Arrange ClassCacheSync <string> subject = new ClassCacheSync <string>(); // Act subject.Retrieve(() => "first-value"); subject.Clear(); string second = subject.Retrieve(() => "second-value"); // Assert second.Should().Be("second-value"); }