Esempio n. 1
0
        public void Should_Create_StartWatch_command_with_pipeline_name()
        {
            var param1 = "param1";
            var param2 = "param2";

            var c = new CmdFactory(new CommandParser(), null);
            var cmd = c.Create("StartWatch " + param1 + " " + param2);
            Assert.That(cmd, Is.InstanceOf<StartWatchCommand>());
            Assert.That(cmd.CommandEntity.Parameter[0], Is.EqualTo(param1));
            Assert.That(cmd.CommandEntity.Parameter[1], Is.EqualTo(param2));
        }
Esempio n. 2
0
        public void Should_return_single_pipeline()
        {
            var cmdParser = MockRepository.GenerateMock<ICommandParser>();
            var ccTray = MockRepository.GenerateMock<ICcTray>();
            var cmdFactory = new CmdFactory(cmdParser, ccTray);

            string cmdLine = "List";
            cmdParser.Expect(x => x.Parse(cmdLine)).Return(new CommandEntity(cmdLine, ""));
            ccTray.Expect(x => x.AllPipelineNames()).Return(new List<string>() { "a"});
            var cmd = cmdFactory.Create(cmdLine);
            //Test

            var response = cmd.Execute();
            //Assert;
            Assert.That(response, Is.EqualTo("a\r\n"));
            cmdParser.VerifyAllExpectations();
            ccTray.VerifyAllExpectations();
        }
Esempio n. 3
0
 public void Should_Create_list_command()
 {
     var c = new CmdFactory(new CommandParser(), null);
     var cmd = c.Create("List");
     Assert.That(cmd, Is.InstanceOf<ListCommand>());
 }