public void When_create_plain_http_context_And_http_context_empty_Then_returns_plain_http_context() { //Act var result = HttpContextExtensions.CreatePlainHttpContext(new DefaultHttpContext()); //Assert Assert.That(result, Is.Not.Null); }
public void When_create_plain_http_context_And_http_context_not_empty_Then_throws_invalid_operation_exception() { //Arrange var plainHttpContext = new PlainHttpContext(); var defaultHttpContext = new DefaultHttpContext(); defaultHttpContext.Features.Set(plainHttpContext); //Act //Assert Assert.Throws <InvalidOperationException>(() => HttpContextExtensions.CreatePlainHttpContext(defaultHttpContext)); }
public void When_create_plain_http_context_And_http_context_null_Then_throws_argument_null_exception() { //Act //Assert Assert.Throws <ArgumentNullException>(() => HttpContextExtensions.CreatePlainHttpContext(null)); }