Exemplo n.º 1
0
        public void TypeSafeSessionAttributeSetNullTest()
        {
            var response = new CEKResponse();

            response.AddSession("dummy", "dummy");
            response.SetSessionAttributesFrom(null);
            Assert.Empty(response.SessionAttributes);
        }
Exemplo n.º 2
0
        public void TypeSafeSessionAttributeSetTest()
        {
            var sessionValue = new OrderInfo
            {
                MenuName   = "Pizza",
                OrderCount = 10,
            };
            var response = new CEKResponse();

            response.SetSessionAttributesFrom(sessionValue);
            Assert.Equal("Pizza", (string)response.SessionAttributes["MenuName"]);
            Assert.Equal(10, (long)response.SessionAttributes["OrderCount"]);
        }