コード例 #1
0
        public void GDCTest2()
        {
            GDC.Clear();
            Assert.False(GDC.Contains("foo"));
            Assert.Equal(string.Empty, GDC.Get("foo"));
            Assert.False(GDC.Contains("foo2"));
            Assert.Equal(string.Empty, GDC.Get("foo2"));

            GDC.Set("foo", "bar");
            GDC.Set("foo2", "bar2");

            Assert.True(GDC.Contains("foo"));
            Assert.Equal("bar", GDC.Get("foo"));

            GDC.Remove("foo");
            Assert.False(GDC.Contains("foo"));
            Assert.Equal(string.Empty, GDC.Get("foo"));

            Assert.True(GDC.Contains("foo2"));
            Assert.Equal("bar2", GDC.Get("foo2"));

            Assert.Null(GDC.GetObject("foo3"));

            Assert.Equal(string.Empty, GDC.Get("foo3", null));
        }
コード例 #2
0
        public void GDCTest2()
        {
            GDC.Clear();
            Assert.IsFalse(GDC.Contains("foo"));
            Assert.AreEqual(string.Empty, GDC.Get("foo"));
            Assert.IsFalse(GDC.Contains("foo2"));
            Assert.AreEqual(string.Empty, GDC.Get("foo2"));

            GDC.Set("foo", "bar");
            GDC.Set("foo2", "bar2");

            Assert.IsTrue(GDC.Contains("foo"));
            Assert.AreEqual("bar", GDC.Get("foo"));

            GDC.Remove("foo");
            Assert.IsFalse(GDC.Contains("foo"));
            Assert.AreEqual(string.Empty, GDC.Get("foo"));

            Assert.IsTrue(GDC.Contains("foo2"));
            Assert.AreEqual("bar2", GDC.Get("foo2"));
        }