示例#1
0
        public void RemoveTest()
        {
            ThreadLogContext target = Log.ThreadContext;
            string           key    = "RemoveTest";

            target[key] = 1;
            Assert.AreEqual(true, target.ContainsKey(key));
            target.Remove(key);
            Assert.AreEqual(false, target.ContainsKey(key));
        }
示例#2
0
        public void ClearTest()
        {
            ThreadLogContext target = Log.ThreadContext;
            string           key    = "ClearTest";

            target[key] = 1;
            target.Clear();
            Assert.AreEqual(false, target.ContainsKey(key));
        }
示例#3
0
        public void PushTest()
        {
            ThreadLogContext target = Log.ThreadContext;
            string           key    = "PushTest";
            object           value  = "PushedValue";

            using (target.Push(key, value))
            {
                object actual = target[key];
                Assert.AreEqual(value, actual);
            }
            Assert.IsFalse(target.ContainsKey(key));
        }