Esempio n. 1
0
        public void testKillApp_invalidAppId()
        {
            var ctrlMock = new Mock<IDirigentControl>();
            var appIdTuple = new AppIdTuple("justmachine.");
            ctrlMock.Setup(f => f.KillApp(appIdTuple));

            var cmdRepo = new CommandRepository();
            cmdRepo.Register(new Commands.KillApp(ctrlMock.Object));
            cmdRepo.ParseAndExecute(new List<string>() { "KillApp", "justmachine." });

            //Assert.AreEqual(");
        }
Esempio n. 2
0
        public void testKillApp()
        {
            var ctrlMock = new Mock<IDirigentControl>();
            var appIdTuple = new AppIdTuple("m1.a");
            ctrlMock.Setup(f => f.KillApp(appIdTuple)).Verifiable();

            var cmdRepo = new CommandRepository();
            cmdRepo.Register(new Commands.KillApp(ctrlMock.Object));
            cmdRepo.ParseAndExecute(new List<string>() { "KillApp", "m1.a" });

            ctrlMock.Verify();

            //Assert.AreEqual(");
        }
Esempio n. 3
0
        public void testSelectPlan()
        {
            var ctrlMock = new Mock<IDirigentControl>();
            var appIdTuple = new AppIdTuple("m1.a");
            var appDef = new AppDef() { AppIdTuple = appIdTuple };
            var plan = new LaunchPlan("plan1", new List<AppDef>() { appDef } );
            var planRepo = new List<ILaunchPlan>() { plan };
            ctrlMock.Setup(f => f.GetPlanRepo()).Returns(planRepo);
            ctrlMock.Setup(f => f.SelectPlan(plan)).Verifiable();

            var cmdRepo = new CommandRepository();
            cmdRepo.Register( new Commands.SelectPlan(ctrlMock.Object) );
            cmdRepo.ParseAndExecute(new List<string>() { "SelectPlan", "plan1" });

            ctrlMock.Verify();

            //Assert.AreEqual(");
        }
Esempio n. 4
0
        public void testUnknownCommand()
        {
            var ctrlMock = new Mock<IDirigentControl>();

            var cmdRepo = new CommandRepository();
            cmdRepo.ParseAndExecute(new List<string>() { "Unknown!!!", "plan1" });
        }