コード例 #1
0
ファイル: FastMapTest.cs プロジェクト: radtek/taste.net
        private static FastMap <String, String> BuildTestFastMap()
        {
            FastMap <String, String> map = new FastMap <String, String>();

            map.Add("foo", "bar");
            map.Add("baz", "bang");
            map.Add("alpha", "beta");
            return(map);
        }
コード例 #2
0
ファイル: FastMapTest.cs プロジェクト: radtek/taste.net
        public void testGrow()
        {
            FastMap <String, String> map = new FastMap <String, String>(1, FastMap <string, string> .NO_MAX_SIZE);

            map.Add("foo", "bar");
            map.Add("baz", "bang");
            Assert.AreEqual("bar", map["foo"]);
            Assert.AreEqual("bang", map["baz"]);
        }
コード例 #3
0
ファイル: FastMapTest.cs プロジェクト: radtek/taste.net
        public void TestMaxSize()
        {
            FastMap <String, String> map = new FastMap <String, String>(1, 1);

            map.Add("foo", "bar");
            Assert.AreEqual(1, map.Count);
            map.Add("baz", "bang");
            Assert.AreEqual(1, map.Count);
            Assert.IsNull(map["foo"]);
            map.Add("baz", "buzz");
            Assert.AreEqual(1, map.Count);
            Assert.AreEqual("buzz", map["baz"]);
        }
コード例 #4
0
ファイル: FastMapTest.cs プロジェクト: ccollie/taste.net
 public void TestPutAndGet()
 {
     FastMap<String, String> map = new FastMap<String, String>();
     Assert.IsNull(map["foo"]);
     
     map.Add("foo", "bar");
     Assert.AreEqual("bar", map["foo"]);
 }
コード例 #5
0
ファイル: FastMapTest.cs プロジェクト: ccollie/taste.net
 public void TestClear()
 {
     FastMap<String, String> map = new FastMap<String, String>();
     map.Add("foo", "bar");
     map.Clear();
     Assert.AreEqual(0, map.Count);
     Assert.IsTrue(map.IsEmpty);
     Assert.IsNull(map["foo"]);
 }
コード例 #6
0
ファイル: FastMapTest.cs プロジェクト: radtek/taste.net
        public void TestPutAndGet()
        {
            FastMap <String, String> map = new FastMap <String, String>();

            Assert.IsNull(map["foo"]);

            map.Add("foo", "bar");
            Assert.AreEqual("bar", map["foo"]);
        }
コード例 #7
0
ファイル: FastMapTest.cs プロジェクト: radtek/taste.net
        public void TestClear()
        {
            FastMap <String, String> map = new FastMap <String, String>();

            map.Add("foo", "bar");
            map.Clear();
            Assert.AreEqual(0, map.Count);
            Assert.IsTrue(map.IsEmpty);
            Assert.IsNull(map["foo"]);
        }
コード例 #8
0
ファイル: FastMapTest.cs プロジェクト: ccollie/taste.net
 public void TestSizeEmpty()
 {
     FastMap<String, String> map = new FastMap<String, String>();
     Assert.AreEqual(0, map.Count);
     Assert.IsTrue(map.IsEmpty);
     map.Add("foo", "bar");
     Assert.AreEqual(1, map.Count);
     Assert.IsFalse(map.IsEmpty);
     map.Remove("foo");
     Assert.AreEqual(0, map.Count);
     Assert.IsTrue(map.IsEmpty);
 }
コード例 #9
0
ファイル: FastMapTest.cs プロジェクト: radtek/taste.net
        public void TestSizeEmpty()
        {
            FastMap <String, String> map = new FastMap <String, String>();

            Assert.AreEqual(0, map.Count);
            Assert.IsTrue(map.IsEmpty);
            map.Add("foo", "bar");
            Assert.AreEqual(1, map.Count);
            Assert.IsFalse(map.IsEmpty);
            map.Remove("foo");
            Assert.AreEqual(0, map.Count);
            Assert.IsTrue(map.IsEmpty);
        }
コード例 #10
0
ファイル: FastMapTest.cs プロジェクト: radtek/taste.net
        public void TestNull()
        {
            FastMap <String, String> map = new FastMap <String, String>();

            try
            {
                map.Add(null, "bar");
                Assert.Fail("Should have thrown NullReferenceException");
            }
            catch (ArgumentNullException)
            {
            }

            try
            {
                map.Add("foo", null);
                Assert.Fail("Should have thrown ArgumentNullException");
            }
            catch (ArgumentNullException)
            {
                // good
            }
            Assert.IsNull(map[null]);
        }
コード例 #11
0
ファイル: FastMapTest.cs プロジェクト: ccollie/taste.net
        public void TestNull() 
        {
            FastMap<String, String> map = new FastMap<String, String>();
            try
            {
                map.Add(null, "bar");
                Assert.Fail("Should have thrown NullReferenceException");
            }
            catch (ArgumentNullException)
            {
            }

            try
            {
                map.Add("foo", null);
                Assert.Fail("Should have thrown ArgumentNullException");
            }
            catch (ArgumentNullException)
            {
                // good
            }
            Assert.IsNull(map[null]);
        }
コード例 #12
0
ファイル: FastMapTest.cs プロジェクト: ccollie/taste.net
 private static FastMap<String, String> BuildTestFastMap()
 {
     FastMap<String, String> map = new FastMap<String, String>();
     map.Add("foo", "bar");
     map.Add("baz", "bang");
     map.Add("alpha", "beta");
     return map;
 }
コード例 #13
0
ファイル: FastMapTest.cs プロジェクト: ccollie/taste.net
 public void TestMaxSize()
 {
     FastMap<String, String> map = new FastMap<String, String>(1, 1);
     map.Add("foo", "bar");
     Assert.AreEqual(1, map.Count);
     map.Add("baz", "bang");
     Assert.AreEqual(1, map.Count);
     Assert.IsNull(map["foo"]);
     map.Add("baz", "buzz");
     Assert.AreEqual(1, map.Count);
     Assert.AreEqual("buzz", map["baz"]);
 }
コード例 #14
0
ファイル: FastMapTest.cs プロジェクト: ccollie/taste.net
 public void testGrow()
 {
     FastMap<String, String> map = new FastMap<String, String>(1, FastMap<string,string>.NO_MAX_SIZE);
     map.Add("foo", "bar");
     map.Add("baz", "bang");
     Assert.AreEqual("bar", map["foo"]);
     Assert.AreEqual("bang", map["baz"]);
 }