public async void GetStatusForBackgroundJob_EmptyBackgroundJobId_ReturnsBadRequestObjectResult() { // Arrange var backgroundJobId = ""; var backgroundJobsHandler = new Mock <IBackgroundJobsHandler>(); var backgroundJobController = new BackgroundJobController(backgroundJobsHandler.Object); // Act var result = await backgroundJobController.GetStatusForBackgroundJob(backgroundJobId); // Assert Assert.NotNull(result); }
public async void GetStatusForBackgroundJob_ValidBackgroundJobId_ReturnsBadRequestResult() { // Arrange var backgroundJobId = "5aec01fa8826ca000777996d"; var backgroundJobsHandler = new Mock <IBackgroundJobsHandler>(); backgroundJobsHandler .Setup(m => m.GetJobStatusForBackgroundJobId(backgroundJobId)) .ReturnsAsync(BackgroundJobStateEnum.StateProcessingForBackgroundJob); var backgroundJobController = new BackgroundJobController(backgroundJobsHandler.Object); // Act var result = await backgroundJobController.GetStatusForBackgroundJob(backgroundJobId); // Assert Assert.NotNull(result); }
public BackgroundJobControllerTest() { _mockLogger = new Mock <ILogger <BackgroundJobController> >(); _mockbghsDbContext = new Mock <IBGHSDbContext>(); backgroundJobController = new BackgroundJobController(_mockLogger.Object, _mockbghsDbContext.Object); }