示例#1
0
        public void prop_Count_get()
        {
            var obj = new WebCacheCollection();

            try
            {
                Assert.Equal(0, obj.Count);
                obj.Add(AlphaDecimal.Random(), new object());
                Assert.Equal(1, obj.Count);
            }
            finally
            {
                obj.Clear();
            }
        }
示例#2
0
        public void op_Add_string_object_TimeSpan()
        {
            var obj = new WebCacheCollection();

            try
            {
                var key      = AlphaDecimal.Random();
                var expected = new object();
                obj.Add(key, expected, new TimeSpan(12345));
                var actual = obj[key];

                Assert.Same(expected, actual);
            }
            finally
            {
                obj.Clear();
            }
        }
示例#3
0
        public void op_Add_string_object_DateTime()
        {
            var obj = new WebCacheCollection();

            try
            {
                var key      = AlphaDecimal.Random();
                var expected = new object();
                obj.Add(key, expected, DateTime.UtcNow.AddDays(1));
                var actual = obj[key];

                Assert.Same(expected, actual);
            }
            finally
            {
                obj.Clear();
            }
        }