Ejemplo n.º 1
0
        public void SetValueShouldSetValueInResponse()
        {
            const string testKey = "MyTestKey";
            const string fullKey = "System.String:" + testKey;
            const string value   = "12345";

            _valueProvider.SetValue <string>(testKey, value);

            Assert.True(_httpContextWrapper.RequestContainsCookie(fullKey));
            Assert.Equal(value, _httpContextWrapper.RequestGetCookieValue(fullKey));
        }
        public void SetValueShouldSetValueInResponse()
        {
            const string testKey = "MyTestKey";
            const string fullKey = "System.String:" + testKey;
            const string value   = "12345";

            _valueProvider.SetValue <string>(testKey, value);

            Assert.IsTrue(HttpContext.Current.Response.Cookies.AllKeys.Contains(fullKey));
            Assert.AreEqual(value, HttpContext.Current.Response.Cookies[fullKey].Value);
        }