コード例 #1
0
ファイル: Program.cs プロジェクト: pweibel/DotNetCaching
        public static void Main(string[] args)
        {
            IInitialValue boInitialValue = new InitialValueBO();
            string strKey = "Test";

            string value1 = boInitialValue.GetValue<string>(strKey);
            string value2 = boInitialValue.GetValue<string>(strKey);

            Console.WriteLine("Value 1: {0}, Value 2: {1}", value1, value2);
            Console.Read();
        }
コード例 #2
0
        public void TestGetValue()
        {
            // Arrange
            IInitialValue boInitialValue = new InitialValueBO();
            string strKey = "Test";
            string strValue = "TestResult";
            boInitialValue.SetValue(strKey, strValue);

            // Act
            string strResult = boInitialValue.GetValue<string>(strKey);

            // Assert
            Assert.AreEqual(strValue, strResult);
        }
コード例 #3
0
        public void TestGetValue()
        {
            // Arrange
            IInitialValue boInitialValue = new InitialValueBO();
            string        strKey         = "Test";
            string        strValue       = "TestResult";

            boInitialValue.SetValue(strKey, strValue);

            // Act
            string strResult = boInitialValue.GetValue <string>(strKey);

            // Assert
            Assert.AreEqual(strValue, strResult);
        }
コード例 #4
0
        public void TestGetValue_With_Two_Queries()
        {
            // Arrange
            IInitialValue boInitialValue = new InitialValueBO();
            string strKey = "Test";
            string strValue = "TestResult" + DateTime.Now;
            boInitialValue.SetValue(strKey, strValue);

            // Act
            string strResult1 = boInitialValue.GetValue<string>(strKey);
            string strResult2 = boInitialValue.GetValue<string>(strKey);

            // Assert
            Assert.AreEqual(strValue, strResult1);
            Assert.AreEqual(strValue, strResult2);
        }
コード例 #5
0
        public void TestGetValue_With_Two_Queries()
        {
            // Arrange
            IInitialValue boInitialValue = new InitialValueBO();
            string        strKey         = "Test";
            string        strValue       = "TestResult" + DateTime.Now;

            boInitialValue.SetValue(strKey, strValue);

            // Act
            string strResult1 = boInitialValue.GetValue <string>(strKey);
            string strResult2 = boInitialValue.GetValue <string>(strKey);

            // Assert
            Assert.AreEqual(strValue, strResult1);
            Assert.AreEqual(strValue, strResult2);
        }