Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
        public async Task GetServiceWatcherItemsTestAsync()
        {
            // Arrange
            var logger         = LoggerMocker.GetLogger <IDashboardBusinessObject>();
            var businessObject = BusinessObjectMocker.GetDashboardBusinessObject();
            var controller     = new DashboardController(logger, businessObject);

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

            // Assert
            var value = response.Value as IListViewModelResponse <ServiceWatcherItemDto>;

            Assert.False(value.DidError);
        }
Ejemplo n.º 3
0
        public async Task GetServiceStatusDetailsTestAsync()
        {
            // Arrange
            var logger         = LoggerMocker.GetLogger <IDashboardBusinessObject>();
            var businessObject = BusinessObjectMocker.GetDashboardBusinessObject();
            var controller     = new DashboardController(logger, businessObject);
            var userName       = "******";

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

            // Assert
            var value = response.Value as IListViewModelResponse <ServiceStatusDetailDto>;

            Assert.False(value.DidError);
        }