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"); }
public void ShouldFailToParseCommandStringWithWhiteSpace() { Assert.Throws <ArgumentException>(() => DefaultRemoteCommand.Parse(" ")); }
public void ShouldFailToParseNullCommandString() { Assert.Throws <ArgumentException>(() => DefaultRemoteCommand.Parse(null)); }
public void ShouldFailToParseCommandStringWhichDoesNotStartWithAPipe() { Assert.Throws <ArgumentException>(() => DefaultRemoteCommand.Parse("command|blah|blah|blah|")); }
public void ShouldFailToParseCommandStringWithExtraPipes() { Assert.Throws <ArgumentException>(() => DefaultRemoteCommand.Parse("|command|blah|blah|blah|")); }
public void ShouldFailToParseCommandStringWithNoPipes() { Assert.Throws <ArgumentException>(() => DefaultRemoteCommand.Parse("junk")); }