[TestClass] public class HealthCheckHttpTriggerTests { private const string CategoryIntegration = "Integration"; private ServerFixture _fixture; [TestInitialize] public void Init() { this._fixture = new LocalhostServerFixture(); } [TestMethod] [TestCategory(CategoryIntegration)] public async Task Given_Url_When_Invoked_Then_Trigger_Should_Return_Healthy() { // Arrange var uri = this._fixture.GetHealthCheckUrl(); using (var http = new HttpClient()) // Act using (var res = await http.GetAsync(uri)) { // Assert res.StatusCode.Should().Be(HttpStatusCode.OK); } } [TestMethod] [TestCategory(CategoryIntegration)] public async Task Given_Url_When_Invoked_Then_Trigger_Should_Return_Unhealthy() { // Arrange var uri = this._fixture.GetHealthCheckUrl(HttpStatusCode.InternalServerError); using (var http = new HttpClient()) // Act using (var res = await http.GetAsync(uri)) { // Assert res.StatusCode.Should().Be(HttpStatusCode.InternalServerError); } } }