public void GetMachineProxyDescriptionFilterTest() { DescriptionBasedInfoProvider target = new DescriptionBasedInfoProvider(_mockedVirtualMachineProxy.Object); IVirtualMachineProxy filteredProxy = target.GetMachineProxyDescriptionFilter(); Assert.AreEqual("Wolf", filteredProxy.getDescription()); }
public override Machine buildMachine(IVirtualMachineProxy proxy) { DescriptionBasedInfoProvider infoProvider = new DescriptionBasedInfoProvider(proxy); ServiceAwareMachine m = new ServiceAwareMachine(infoProvider.GetMachineProxyDescriptionFilter()); m.ServiceInfoProvider = infoProvider; return(m); }
public override Machine buildMachine(IVirtualMachineProxy proxy) { DescriptionBasedInfoProvider infoProvider = new DescriptionBasedInfoProvider(proxy); ServiceAwareMachine m = new ServiceAwareMachine(infoProvider.GetMachineProxyDescriptionFilter()); m.ServiceInfoProvider = infoProvider; return m; }
public void getShutdownMethodTest() { DescriptionBasedInfoProvider ip = new DescriptionBasedInfoProvider(_mockedVirtualMachineProxy.Object); Assert.IsInstanceOfType(ip.getShutdownMethod(), typeof(ACPIShutdownMethod)); _mockedVirtualMachineProxy.Setup(x => x.getDescription()).Returns("Wolf Huhn\n <!VirtualboxService--{\"Autostart\":\"true\", \"ACPIShutdownTimeout\":\"100\"}--/VirtualboxService>"); Assert.IsInstanceOfType(ip.getShutdownMethod(), typeof(SaveStateMethod)); _mockedVirtualMachineProxy.Setup(x => x.getDescription()).Returns(String.Empty); Assert.IsInstanceOfType(ip.getShutdownMethod(), typeof(SaveStateMethod)); }
public void getRealDescriptionTest() { _mockedVirtualMachineProxy.Setup(x => x.getDescription()).Returns("Wolf Huhn\n <!VirtualboxService--{\"Autostart\":\"true\", \"ShutdownType\":\"ACPIShutdown\", \"ACPIShutdownTimeout\":\"100\"}--/VirtualboxService>"); DescriptionBasedInfoProvider ip = new DescriptionBasedInfoProvider(_mockedVirtualMachineProxy.Object); Assert.AreEqual("Wolf Huhn\n ", ip.getRealDescription()); }
public void getAutoBootDefaultTest() { _mockedVirtualMachineProxy.Setup(x => x.getDescription()).Returns("Wolf<!VirtualboxService--{\"ShutdownType\":\"ACPIShutdown\"}--/VirtualboxService>"); DescriptionBasedInfoProvider ip = new DescriptionBasedInfoProvider(_mockedVirtualMachineProxy.Object); Assert.AreEqual(false, ip.getAutoBoot()); }
public void getAutoBootTest() { DescriptionBasedInfoProvider ip = new DescriptionBasedInfoProvider(_mockedVirtualMachineProxy.Object); Assert.AreEqual(true, ip.getAutoBoot()); }
public void getACPIShutdownTimeoutMilliSecondsDefaultTest() { _mockedVirtualMachineProxy.Setup(x => x.getDescription()).Returns("Wolf<!VirtualboxService--{\"Autostart\":\"true\", \"ShutdownType\":\"ACPIShutdown\"}--/VirtualboxService>"); DescriptionBasedInfoProvider ip = new DescriptionBasedInfoProvider(_mockedVirtualMachineProxy.Object); Assert.AreEqual(10000, ip.getACPIShutdownTimeoutMilliSeconds()); }
public void getACPIShutdownTimeoutMilliSecondsTest() { DescriptionBasedInfoProvider ip = new DescriptionBasedInfoProvider(_mockedVirtualMachineProxy.Object); Assert.AreEqual(100, ip.getACPIShutdownTimeoutMilliSeconds()); }
public MachineProxyDescriptionFilter(IVirtualMachineProxy innerProxy, DescriptionBasedInfoProvider innerDescriptionInfoProvider) { _innerProxy = innerProxy; _innerDescriptionInfoProvider = innerDescriptionInfoProvider; }