示例#1
0
        public void TestTryGetInternal()
        {
            MyValue value = myMetaCache.GetAndChange();

            value.Value = "value1";

            cloneMetaCache.Get().Should().Be(value);
        }
示例#2
0
        public void TestCommitAndAddInternal()
        {
            MyValue value = myMetaCache.Get();

            value.Should().NotBeNull();
            value.Value.Should().BeNull();

            myMetaCache.Commit();
            myMetaCache.Value.Should().Be(value);
        }
示例#3
0
        public void TestCommitAndUpdateInternal()
        {
            MyValue value = myMetaCache.GetAndChange();

            value.Value = "value1";

            myMetaCache.Commit();
            myMetaCache.Value.Should().Be(value);
            myMetaCache.Value.Value.Should().Be("value1");
        }
示例#4
0
        public void TestUpdateInternal()
        {
            MyValue value = myMetaCache.GetAndChange();

            value.Value = "value1";

            MyValue value2 = cloneMetaCache.GetAndChange();

            value2.Value = "value2";

            cloneMetaCache.Commit();
            value.Value.Should().Be("value2");
        }
示例#5
0
 protected override void UpdateInternal(StorageKey key, StorageItem value)
 {
     InnerDict[key] = new MyValue(value.Value);
 }