コード例 #1
0
        public void UpdateEntryViaAlgorithmShouldBeFirst()
        {
            //Arrange
            string key1   = "1";
            int    value1 = 1;
            string key2   = "2";
            int    value2 = 2;

            var algorithm = new LRUAlgorithm <string, int>();

            algorithm.Add(key1, value1);
            algorithm.Add(key2, value2);
            algorithm.Update(key1);

            //Actual
            //Assert
            Assert.IsTrue(algorithm.IsKeyValuePairFirst(key1));
        }
コード例 #2
0
        public void AddEntryToHashMapShouldBeSuccess()
        {
            //Arrange
            string key           = "55";
            int    expectedValue = 4;
            var    algorithm     = new LRUAlgorithm <string, double>();

            algorithm.Add(key, expectedValue);

            //Actual
            var actualValue = algorithm.GetValue(key);

            //Assert
            Assert.AreEqual(expectedValue, actualValue);
        }