public async Task IfRequestDoesNotContainLastEventId_LastEventIdPropertyShouldBeNull() { var context = FakeHttpContext.NewHttpContext(); var sut = await HttpClient.NewClient(context); sut.LastEventId.Should().BeNull(); }
private async Task <HttpResponse> GetHttpResponseOfNewClient() { var context = FakeHttpContext.NewHttpContext(); var sut = await HttpClient.NewClient(context); return(sut.HttpContext.Response); }
private async Task <HttpResponse> GetHttpResponseWithReconnectingStopped() { var context = FakeHttpContext.NewHttpContext(); await HttpClient.StopReconnecting(context); return(context.Response); }
public async Task IfRequestContainsLastEventId_LastEventIdPropertyShouldBeSetToThisValue() { var context = FakeHttpContext.NewHttpContext(); context.Request.Headers.Add("Last-Event-Id", "someId"); var sut = await HttpClient.NewClient(context); sut.LastEventId.Should().Be("someId"); }
public async Task IfHttpResponseHasAlreadyStarted_ShouldThrowArgumentException() { var context = FakeHttpContext.NewHttpContext(); await context.Response.StartAsync(); Func <Task> createClientAction = async() => await HttpClient.NewClient(context); createClientAction.Should().Throw <ArgumentException>() .WithMessage("*Response * already started*", because: "the header cannot be changed after the response has started"); }
public async Task InitializeAsync() { _context = FakeHttpContext.NewHttpContext(); _sut = await HttpClient.NewClient(_context); }