Ejemplo n.º 1
0
 public ConfigurationFormViewModel(HostConfiguration cfg)
 {
     MaxVMCount = cfg.MaxVMCount;
     MinIP = cfg.MinIP;
     MaxIP = cfg.MaxIP;
     CreateVMTime = cfg.CreateVMTime.TimeOfDay;
     BackupVMTime = cfg.BackupVMTime.TimeOfDay;
     ArchiveVMTime = cfg.ArchiveVMTime.TimeOfDay;
 }
Ejemplo n.º 2
0
        public void TestGetConfigurationEditForm()
        {
            //arrange
            var controller = new ConfigurationController();
            var hostConfig = new HostConfiguration();
            var mockConfigRepo = new Mock<IConfigurationRepository>();
            mockConfigRepo.Setup(r => r.GetHostConfiguration()).Returns(hostConfig);

            //act
            var result=controller.Host() as ViewResult;

            //assert
            mockConfigRepo.Verify();
            Assert.IsNotNull(result);
            Assert.IsInstanceOfType(result.ViewData.Model, typeof(ViewModels.ConfigurationFormViewModel));
        }