Exemplo n.º 1
0
			public void SetUp()
			{
				_configuration = MockRepository.GenerateMock<IAntiCsrfConfiguration>();
				_configuration.Stub(arg => arg.CookieName).Return("name");
				_guidFactory = MockRepository.GenerateMock<IGuidFactory>();
				_request = MockRepository.GenerateMock<HttpRequestBase>();
				_request.Stub(arg => arg.Cookies).Return(new HttpCookieCollection { new HttpCookie("name", _sessionId.ToString("N")) });
				_response = MockRepository.GenerateMock<HttpResponseBase>();
				_response.Stub(arg => arg.Cookies).Return(new HttpCookieCollection());
				_cookieManager = new DefaultManager(_configuration, _guidFactory);
				_cookieManager.ConfigureCookieAsync(_request, _response);
				_sessionId = Guid.Parse("6a9ef3cd-eb3f-49b6-90ba-0dfda4cb183d");
			}
Exemplo n.º 2
0
			public void SetUp()
			{
				_configuration = MockRepository.GenerateMock<IAntiCsrfConfiguration>();
				_configuration.Stub(arg => arg.CookieName).Return("name");
				_guidFactory = MockRepository.GenerateMock<IGuidFactory>();

				var requestCookies = new HttpCookieCollection();
				var responseCookies = new HttpCookieCollection();

				_request = MockRepository.GenerateMock<HttpRequestBase>();
				_request.Stub(arg => arg.Cookies).Return(requestCookies);
				_response = MockRepository.GenerateMock<HttpResponseBase>();
				_response.Stub(arg => arg.Cookies).Return(responseCookies);
				_manager = new DefaultManager(_configuration, _guidFactory);
			}
Exemplo n.º 3
0
			public void SetUp()
			{
				_configuration = MockRepository.GenerateMock<IAntiCsrfConfiguration>();
				_configuration.Stub(arg => arg.CookieName).Return("name");
				_guidFactory = MockRepository.GenerateMock<IGuidFactory>();
				_response = MockRepository.GenerateMock<HttpResponseBase>();
				_sessionId = Guid.Parse("98b92ab2-3905-4e25-aefe-cff7dc5df9d3");
				_response.Stub(arg => arg.Cookies).Return(new HttpCookieCollection { new HttpCookie("name", _sessionId.ToString("N")) { HttpOnly = true } });
				_cookieManager = new DefaultManager(_configuration, _guidFactory);
			}