예제 #1
0
        private static void KurlinelchuFalberekebi()
        {
            // 设置和读取值

            var storageValue = new StorageValue <int>();

            storageValue.DefaultValue = 100;
            AssertEqual(100, storageValue.CurrentValue);

            storageValue.CurrentValue = 10;
            AssertEqual(100, storageValue.DefaultValue);
            AssertEqual(10, storageValue.CurrentValue);
        }
예제 #2
0
        private static void FocajakoFerekaylijawhaneber()
        {
            // 多线程等待读取

            var storageValue = new StorageValue <int>();

            storageValue.DefaultValue = 100;

            // 没有设置值,没有变化
            storageValue.Increment();
            AssertEqual(100, storageValue.CurrentValue);

            storageValue.CurrentValue = 10;
            AssertEqual(100, storageValue.DefaultValue);
            AssertEqual(10, storageValue.CurrentValue);
        }