コード例 #1
0
		public void StableDictionary_AddElement_Test()
		{
			StableDictionary<int, string> dictionary = new StableDictionary<int, string>();
			dictionary.Add(1, "a");
			dictionary.Add(2, "b");
			dictionary.Add(3, "c");
			dictionary.Add(4, "d");
			Assert.AreEqual(4, dictionary.Count);
			Assert.IsTrue(dictionary.ContainsKey(1));
			Assert.IsTrue(dictionary.ContainsKey(2));
			Assert.IsTrue(dictionary.ContainsKey(3));
			Assert.IsTrue(dictionary.ContainsKey(4));
			Assert.IsTrue(dictionary.ContainsValue("a"));
			Assert.IsTrue(dictionary.ContainsValue("b"));
			Assert.IsTrue(dictionary.ContainsValue("c"));
			Assert.IsTrue(dictionary.ContainsValue("d"));
		}
コード例 #2
0
        public void StableDictionary_AddElement_Test()
        {
            StableDictionary <int, string> dictionary = new StableDictionary <int, string>();

            dictionary.Add(1, "a");
            dictionary.Add(2, "b");
            dictionary.Add(3, "c");
            dictionary.Add(4, "d");
            Assert.AreEqual(4, dictionary.Count);
            Assert.IsTrue(dictionary.ContainsKey(1));
            Assert.IsTrue(dictionary.ContainsKey(2));
            Assert.IsTrue(dictionary.ContainsKey(3));
            Assert.IsTrue(dictionary.ContainsKey(4));
            Assert.IsTrue(dictionary.ContainsValue("a"));
            Assert.IsTrue(dictionary.ContainsValue("b"));
            Assert.IsTrue(dictionary.ContainsValue("c"));
            Assert.IsTrue(dictionary.ContainsValue("d"));
        }
コード例 #3
0
		public void StableDictionary_RemoveElement_Test()
		{
			StableDictionary<int, string> dictionary = new StableDictionary<int, string>();
			dictionary.Add(1, "a");
			dictionary.Add(2, "b");
			dictionary.Add(3, "c");
			dictionary.Add(4, "d");
			dictionary.Remove(1);
			Assert.AreEqual(3, dictionary.Count);
			Assert.IsFalse(dictionary.ContainsKey(1));
			Assert.IsFalse(dictionary.ContainsValue("a"));
		}
コード例 #4
0
        public void StableDictionary_RemoveElement_Test()
        {
            StableDictionary <int, string> dictionary = new StableDictionary <int, string>();

            dictionary.Add(1, "a");
            dictionary.Add(2, "b");
            dictionary.Add(3, "c");
            dictionary.Add(4, "d");
            dictionary.Remove(1);
            Assert.AreEqual(3, dictionary.Count);
            Assert.IsFalse(dictionary.ContainsKey(1));
            Assert.IsFalse(dictionary.ContainsValue("a"));
        }