public void ShouldCreateDefaultRemoteCommand()
        {
            string commandString         = "open";
            string argument1             = "http://localhost";
            string argument2             = "";
            DefaultRemoteCommand command = new DefaultRemoteCommand(commandString, new string[] { argument1, argument2 });

            Assert.AreEqual("cmd=open&1=http%3a%2f%2flocalhost&2=", command.CommandString);
        }
        public void ShouldParseCommandWithFourPipes()
        {
            string openCommand           = "|setTextField|fieldName|fieldValue|";
            DefaultRemoteCommand command = DefaultRemoteCommand.Parse(openCommand);

            Assert.AreEqual("setTextField", command.Command);
            Assert.AreEqual("fieldName", command.Args[0]);
            Assert.AreEqual("fieldValue", command.Args[1]);
        }
 public void ShouldFailToParseCommandStringWithWhiteSpace()
 {
     DefaultRemoteCommand.Parse("  ");
 }
 public void ShouldFailToParseNullCommandString()
 {
     DefaultRemoteCommand.Parse(null);
 }
 public void ShouldFailToParseCommandStringWhichDoesNotStartWithAPipe()
 {
     DefaultRemoteCommand.Parse("command|blah|blah|blah|");
 }
 public void ShouldFailToParseCommandStringWithExtraPipes()
 {
     DefaultRemoteCommand.Parse("|command|blah|blah|blah|");
 }
 public void ShouldFailToParseCommandStringWithNoPipes()
 {
     DefaultRemoteCommand.Parse("junk");
 }
Ejemplo n.º 8
0
 public void ShouldFailToParseCommandStringWithWhiteSpace()
 {
     Assert.Throws <ArgumentException>(() => DefaultRemoteCommand.Parse("  "));
 }
Ejemplo n.º 9
0
 public void ShouldFailToParseNullCommandString()
 {
     Assert.Throws <ArgumentException>(() => DefaultRemoteCommand.Parse(null));
 }
Ejemplo n.º 10
0
 public void ShouldFailToParseCommandStringWhichDoesNotStartWithAPipe()
 {
     Assert.Throws <ArgumentException>(() => DefaultRemoteCommand.Parse("command|blah|blah|blah|"));
 }
Ejemplo n.º 11
0
 public void ShouldFailToParseCommandStringWithExtraPipes()
 {
     Assert.Throws <ArgumentException>(() => DefaultRemoteCommand.Parse("|command|blah|blah|blah|"));
 }
Ejemplo n.º 12
0
 public void ShouldFailToParseCommandStringWithNoPipes()
 {
     Assert.Throws <ArgumentException>(() => DefaultRemoteCommand.Parse("junk"));
 }