Exemple #1
0
		public void MissingCommand()
		{
      var cmd = new Cmd.Repeat();
			base.InitCommand(cmd);

			cmd.Number = "7";

			var result = cmd.Run();

      Assert.That(result.Status, Is.EqualTo(CommandStatus.Failure));
		}
Exemple #2
0
		public void RepeatSimple()
		{
			var cmd = new Cmd.Repeat();
			base.InitCommand(cmd);

			cmd.Number = "3";
			cmd.Command = "echo $num$";

			var result = cmd.Run();

      Assert.That(result.Status, Is.EqualTo(CommandStatus.Success));
			Assert.That(result.Message, Is.EqualTo("1\r\n2\r\n3\r\n"));
		}
Exemple #3
0
		public void WithRelativePath()
		{
			var cmd = new Cmd.Repeat();
			base.InitCommand(cmd);

			cmd.Number = "4";
			cmd.Command = "touch -t (" + Constants.Paths.DocTemplate + ") (item $num$)";
			cmd.Path = _testRoot.Paths.FullPath;

			var result = cmd.Run();

      Assert.That(result.Status, Is.EqualTo(CommandStatus.Success));
			Assert.That(_testRoot.Children.Count, Is.EqualTo(4));
			Assert.That(_testRoot.Children[0].Name, Is.EqualTo("item 1"));
      Assert.That(_testRoot.Children[1].Name, Is.EqualTo("item 2"));
      Assert.That(_testRoot.Children[2].Name, Is.EqualTo("item 3"));
      Assert.That(_testRoot.Children[3].Name, Is.EqualTo("item 4"));
		}
Exemple #4
0
		public void NonNumbericNumber()
		{
			var cmd = new Cmd.Repeat();
			base.InitCommand(cmd);

			cmd.Number = "a";
			cmd.Command = "echo $num$";

			var result = cmd.Run();

      Assert.That(result.Status, Is.EqualTo(CommandStatus.Failure));
		}