public void TryGet_unknown_checksum()
        {
            //Arrange
            var target   = new StoreResultCache();
            var checksum = Checksum.Get(Convert.FromBase64String("YZrsXP5n1OVHAFK8YfUZVXpzXFmt7H9sCeaPhMOfdP32LnUvP+HmNFvHVs1CsYR6IzSz3gwi+l285jvV2aWQng=="));

            //Act
            var resultFound = target.TryGet <string>(checksum, out var resultValue);

            //Assert
            Assert.IsFalse(resultFound);
            Assert.IsNull(resultValue);
        }
        public void TryGet_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();

            target.AddOrGet(presistedValue);

            //Act
            var result = target.TryGet <string>(presistedValue.GetPresistedValue().Checksum, out var resultValue);

            //Assert
            Assert.IsTrue(result);
            Assert.AreSame(presistedValue, resultValue);
        }
        public void TryGet_null()
        {
            //Arrange
            var target = new StoreResultCache();

            //Act
            try
            {
                target.TryGet <string>(null, out var resultValue);
            }
            catch (ArgumentNullException)
            {
                return;
            }

            //Assert
            Assert.Fail();
        }