public void Execute_StrategyExecuted_CurrentResponseEnded() {
			var httpContextHandler = A.Fake<IHttpContextHandler>();
			var stategy = new GenericUnauthorizedStrategy(httpContextHandler);

			stategy.Execute();

			A.CallTo(() => httpContextHandler.Current.Response.End()).MustHaveHappened(Repeated.Exactly.Once);
		}
		public void Execute_StrategyExecuted_UnauthorizedHttpCodeSetOnContext() {
			var httpContextHandler = A.Fake<IHttpContextHandler>();
			var stategy = new GenericUnauthorizedStrategy(httpContextHandler);

			stategy.Execute();

			Assert.AreEqual("401 Unauthorized", httpContextHandler.Current.Response.Status);
			Assert.AreEqual(401, httpContextHandler.Current.Response.StatusCode);
		}
		public void Execute_StrategyExecuted_StatusFlushedToCurrentResponseAfterStatusHasBeenSet() {
			var httpContextHandler = A.Fake<IHttpContextHandler>();
			var stategy = new GenericUnauthorizedStrategy(httpContextHandler);

			var status = 0;
			A.CallTo(() => httpContextHandler.Current.Response.Flush()).Invokes(c => status = httpContextHandler.Current.Response.StatusCode);

			stategy.Execute();

			Assert.AreEqual(401, status);
		}
		public void Constructor_SendInAHttpContextBaseFactoryMethodAndStrategyExecuted_StatusSetOnHttpContextReturned() {
			var httpContextBase = A.Fake<HttpContextBase>();
			HttpContext.Current = new HttpContext(new HttpRequest(string.Empty, "http://anyuri.org/", string.Empty), new HttpResponse(null));

			A.CallTo(() => httpContextBase.Request.Url).Returns(new Uri("http://anyuri.org/"));

			var strategy = new GenericUnauthorizedStrategy(() => httpContextBase);

			strategy.Execute();

			Assert.AreEqual(401, httpContextBase.Response.StatusCode);
		}