public async Task Then_If_There_Is_No_Rows_Imported_It_Reports_Unhealthy( [Frozen] Mock <IImportAuditRepository> auditRepository, HealthCheckContext context, LocationImportHealthCheck healthCheck) { //Arrange auditRepository.Setup(x => x.GetLastImportByType(ImportType.OnsLocation)).ReturnsAsync(new ImportAudit(DateTime.Now, 0, "")); //Act var actual = await healthCheck.CheckHealthAsync(context); //Assert actual.Status.Should().Be(HealthStatus.Unhealthy); }
public async Task Then_If_The_Import_Is_Under_Twenty_Five_Hours_Old_Show_Healthy( [Frozen] Mock <IImportAuditRepository> auditRepository, HealthCheckContext context, LocationImportHealthCheck healthCheck) { //Arrange auditRepository.Setup(x => x.GetLastImportByType(ImportType.OnsLocation)).ReturnsAsync(new ImportAudit(DateTime.UtcNow.AddHours(25).AddMinutes(-1), 10)); //Act var actual = await healthCheck.CheckHealthAsync(context); //Assert actual.Status.Should().Be(HealthStatus.Healthy); }