public void AcceptedWithContentOnly() { var controller = new DummyController { Configuration = new HttpConfiguration(), Request = new HttpRequestMessage() }; var content = "yay!"; var result = controller.Accepted(content); result.Should().BeOfType <AcceptedResult <string> >().And.Should().NotBeNull("because a result should have been generated"); result.ResponseContent.Should().Be(content, "because the content have been returned."); result.RetryAfter.Should().Be(TimeSpan.Zero, "because the duration not have been set"); }
public void AcceptedWithContentAndRetry() { var controller = new DummyController { Configuration = new HttpConfiguration(), Request = new HttpRequestMessage() }; var retrySeconds = TimeSpan.FromSeconds(30); var content = 12.0f; var result = controller.Accepted(content, retrySeconds); result.Should().BeOfType <AcceptedResult <float> >().And.Should().NotBeNull("because a result should have been generated"); result.ResponseContent.Should().Be(content, "because the content have been returned."); result.RetryAfter.Should().Be(retrySeconds, "because the duration should match the provided TimeSpan"); }