public async Task CreateServiceStatusLogTestAsync() { // Arrange using (var businessObject = BusinessObjectMocker.GetAdministrationBusinessObject()) { var logger = LoggerMocker.GetLogger <IAdministrationBusinessObject>(); var controller = new AdministrationController(logger, businessObject); var viewModel = new ServiceEnvironmentStatusLogVm { ServiceEnvironmentID = 1, Target = "192.168.1.1", ActionName = "Ping", Success = true, Date = DateTime.Now }; // Act var response = await controller.CreateServiceStatusLogAsync(viewModel) as ObjectResult; // Assert var value = response.Value as ISingleViewModelResponse <ServiceEnvironmentStatusLog>; Assert.False(value.DidError); } }
public async Task CreateServiceStatusLogTestAsync() { // Arrange var logger = LoggerHelper.GetLogger <IAdministrationService>(); var service = ServiceMocker.GetAdministrationService(); var controller = new AdministrationController(logger, service); var request = new ServiceEnvironmentStatusLogVm { ServiceEnvironmentID = 1, Target = "192.168.1.1", ActionName = "Ping", Success = true, Date = DateTime.Now }; // Act var response = await controller.CreateServiceStatusLogAsync(request) as ObjectResult; var value = response.Value as ISingleResponse <ServiceEnvironmentStatusLog>; controller.Dispose(); // Assert Assert.False(value.DidError); }