Exemplo n.º 1
0
        public void Issues150_DeepClone_Object_Test()
        {
            var cacheKey = Guid.NewGuid().ToString();

            var cacheValue = new MySettingForCaching {
                Name = "catcherwong"
            };

            _provider.Set(cacheKey, cacheValue, _defaultTs);

            var res = _provider.Get <MySettingForCaching>(cacheKey);

            res.Value.Name = "kobe";

            var res2 = _provider.Get <MySettingForCaching>(cacheKey);

            Assert.Equal("catcherwong", res2.Value.Name);
        }
Exemplo n.º 2
0
        public void Disable_Read_And_Disable_Write_DeepClone_Should_Succeed()
        {
            var cacheKey = Guid.NewGuid().ToString();

            var cacheValue = new MySettingForCaching {
                Name = "catcherwong"
            };

            _m3.Set(cacheKey, cacheValue, _defaultTs);

            cacheValue.Name = "afterset";

            var res = _m3.Get <MySettingForCaching>(cacheKey);

            res.Value.Name = "kobe";

            var res2 = _m3.Get <MySettingForCaching>(cacheKey);

            Assert.Equal("kobe", res2.Value.Name);
        }