public void ServiceUnavailable() { var controller = new DummyController { Configuration = new HttpConfiguration(), Request = new HttpRequestMessage() }; var retryAfter = TimeSpan.FromSeconds(5); var result = controller.ServiceUnavailable(retryAfter); result.Should().BeOfType <ServiceUnavailableResult>().And.Should().NotBeNull("because a result should have been generated"); result.Request.Should().NotBeNull("Retry-After", "because the response should specify the Retry-After."); result.RetryAfter.Should().Be(retryAfter, "because the duration should match the provided TimeSpan"); }