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); }
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); }