public void AddOrGet_string() { //Arrange var store = new Store(new IStorage[] { new DisabledStorageHelperClass() }, cache: new DisabledCacheHelperClass()); StoreResult <string> presistedValue = store.EnsurePresistAsync("StringsAreImmutable").GetAwaiter().GetResult(); var target = new StoreResultCache(); //Act var result = target.AddOrGet(presistedValue); //Assert Assert.AreSame(presistedValue, result); }
public void AddOrGet_null() { //Arrange var target = new StoreResultCache(); //Act try { target.AddOrGet <string>(null); } catch (ArgumentNullException) { return; } //Assert Assert.Fail(); }