コード例 #1
0
ファイル: UnitTest1.cs プロジェクト: Kuznetsova9ks/prog2018
        public void TheSameKeysTest()
        {
            var hashTable = new _4laboratornaya.HashTable(3);

            hashTable.PutPair("1", "A");
            hashTable.PutPair("1", "B");
            Assert.AreEqual(hashTable.GetValueByKey("1"), "B");
        }
コード例 #2
0
ファイル: UnitTest1.cs プロジェクト: Kuznetsova9ks/prog2018
        public void HugeTableElements()
        {
            var hashTable = new _4laboratornaya.HashTable(10000);

            for (int i = 0; i < 10000; i++)
            {
                hashTable.PutPair(i, i + "/");
            }
            Assert.AreEqual(hashTable.GetValueByKey(12), "12/");
        }
コード例 #3
0
ファイル: UnitTest1.cs プロジェクト: Kuznetsova9ks/prog2018
        public void ThausandNullTest()
        {
            var hashTable = new _4laboratornaya.HashTable(10000);

            for (int i = 0; i < 9000; i++)
            {
                hashTable.PutPair(i, i + "/");
            }
            Assert.AreEqual(hashTable.GetValueByKey(503), "503/");
            Assert.AreEqual(hashTable.GetValueByKey(9001), null);
        }
コード例 #4
0
ファイル: UnitTest1.cs プロジェクト: Kuznetsova9ks/prog2018
        public void LittleElementsTest()
        {
            var hashTable = new _4laboratornaya.HashTable(3);

            hashTable.PutPair("1", "A");
            hashTable.PutPair("2", "B");
            hashTable.PutPair("3", "C");
            Assert.AreEqual(hashTable.GetValueByKey("1"), "A");
            Assert.AreEqual(hashTable.GetValueByKey("2"), "B");
            Assert.AreEqual(hashTable.GetValueByKey("3"), "C");
        }