コード例 #1
0
        public void GetMachineProxyDescriptionFilterTest() {
            DescriptionBasedInfoProvider target = new DescriptionBasedInfoProvider(_mockedVirtualMachineProxy.Object);

            IVirtualMachineProxy filteredProxy = target.GetMachineProxyDescriptionFilter();

            Assert.AreEqual("Wolf", filteredProxy.getDescription());
        }
コード例 #2
0
        public override Machine buildMachine(IVirtualMachineProxy proxy)
        {
            DescriptionBasedInfoProvider infoProvider = new DescriptionBasedInfoProvider(proxy);
            ServiceAwareMachine          m            = new ServiceAwareMachine(infoProvider.GetMachineProxyDescriptionFilter());

            m.ServiceInfoProvider = infoProvider;
            return(m);
        }
コード例 #3
0
 public override Machine buildMachine(IVirtualMachineProxy proxy) {
     DescriptionBasedInfoProvider infoProvider = new DescriptionBasedInfoProvider(proxy);
     ServiceAwareMachine m = new ServiceAwareMachine(infoProvider.GetMachineProxyDescriptionFilter());
     m.ServiceInfoProvider = infoProvider;
     return m;
 }
コード例 #4
0
        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));
        }
コード例 #5
0
        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());
        }
コード例 #6
0
        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());
        }
コード例 #7
0
        public void getAutoBootTest() {
            DescriptionBasedInfoProvider ip = new DescriptionBasedInfoProvider(_mockedVirtualMachineProxy.Object);

            Assert.AreEqual(true, ip.getAutoBoot());
        }
コード例 #8
0
        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());
        }
コード例 #9
0
        public void getACPIShutdownTimeoutMilliSecondsTest() {
            DescriptionBasedInfoProvider ip = new DescriptionBasedInfoProvider(_mockedVirtualMachineProxy.Object);

            Assert.AreEqual(100, ip.getACPIShutdownTimeoutMilliSeconds());
        }
コード例 #10
0
 public MachineProxyDescriptionFilter(IVirtualMachineProxy innerProxy, DescriptionBasedInfoProvider innerDescriptionInfoProvider) {
     _innerProxy = innerProxy;
     _innerDescriptionInfoProvider = innerDescriptionInfoProvider;
 }
コード例 #11
0
 public MachineProxyDescriptionFilter(IVirtualMachineProxy innerProxy, DescriptionBasedInfoProvider innerDescriptionInfoProvider)
 {
     _innerProxy = innerProxy;
     _innerDescriptionInfoProvider = innerDescriptionInfoProvider;
 }