public void MachineStateMappingTest() {
            ComMachineProxy machineProxy = new ComMachineProxy(_mockedComMachine.Object);
            
            Assert.AreEqual(VBoxWrapper.MachineState.Off, machineProxy.getState());
            
            _mockedComMachine.SetupGet(x => x.State).Returns(VirtualBox.MachineState.MachineState_Running);
            Assert.AreEqual(VBoxWrapper.MachineState.Running, machineProxy.getState());

            _mockedComMachine.SetupGet(x => x.State).Returns(VirtualBox.MachineState.MachineState_Paused);
            Assert.AreEqual(VBoxWrapper.MachineState.Running, machineProxy.getState());

            _mockedComMachine.SetupGet(x => x.State).Returns(VirtualBox.MachineState.MachineState_Saved);
            Assert.AreEqual(VBoxWrapper.MachineState.SessionSaved, machineProxy.getState());

            _mockedComMachine.SetupGet(x => x.State).Returns(VirtualBox.MachineState.MachineState_Saving);
            Assert.AreEqual(VBoxWrapper.MachineState.InTransition, machineProxy.getState());
        }
예제 #2
0
        public void MachineStateMappingTest()
        {
            ComMachineProxy machineProxy = new ComMachineProxy(_mockedComMachine.Object);

            Assert.AreEqual(VBoxWrapper.MachineState.Off, machineProxy.getState());

            _mockedComMachine.SetupGet(x => x.State).Returns(VirtualBox.MachineState.MachineState_Running);
            Assert.AreEqual(VBoxWrapper.MachineState.Running, machineProxy.getState());

            _mockedComMachine.SetupGet(x => x.State).Returns(VirtualBox.MachineState.MachineState_Paused);
            Assert.AreEqual(VBoxWrapper.MachineState.Running, machineProxy.getState());

            _mockedComMachine.SetupGet(x => x.State).Returns(VirtualBox.MachineState.MachineState_Saved);
            Assert.AreEqual(VBoxWrapper.MachineState.SessionSaved, machineProxy.getState());

            _mockedComMachine.SetupGet(x => x.State).Returns(VirtualBox.MachineState.MachineState_Saving);
            Assert.AreEqual(VBoxWrapper.MachineState.InTransition, machineProxy.getState());
        }