Exemple #1
0
        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);
        }
Exemple #2
0
        public async Task GetServiceWatcherItemsTestAsync()
        {
            // Arrange
            var logger     = LoggerHelper.GetLogger <IDashboardService>();
            var service    = ServiceMocker.GetDashboardService();
            var controller = new DashboardController(logger, service);

            // Act
            var response = await controller.GetServiceWatcherItemsAsync() as ObjectResult;

            var value = response.Value as IListResponse <ServiceWatcherItemDto>;

            controller.Dispose();

            // Assert
            Assert.False(value.DidError);
        }
Exemple #3
0
        public async Task GetServiceStatusDetailsTestAsync()
        {
            // Arrange
            var logger     = LoggerHelper.GetLogger <IDashboardService>();
            var service    = ServiceMocker.GetDashboardService();
            var controller = new DashboardController(logger, service);
            var userName   = "******";

            // Act
            var response = await controller.GetServiceStatusDetailsAsync(userName) as ObjectResult;

            var value = response.Value as IListResponse <ServiceStatusDetailDto>;

            controller.Dispose();

            // Assert
            Assert.False(value.DidError);
        }