Added a few more parser tests

This commit is contained in:
David Sparer
2016-09-28 10:53:06 -06:00
parent 91da8f1b5f
commit f53e77ecc9

View File

@@ -14,6 +14,7 @@ namespace mRemoteNGTests.Tools
private const string StringAfterNoEscaping = TestString;
private const int Port = 9933;
private const string PortAsString = "9933";
private const string SampleCommandString = @"/k echo ()%!^abc123*<>&|""'\";
[OneTimeSetUp]
@@ -76,6 +77,11 @@ namespace mRemoteNGTests.Tools
[TestCase("%USERFIELD%", ExpectedResult = StringAfterAllEscaping)]
[TestCase("%-USERFIELD%", ExpectedResult = StringAfterMetacharacterEscaping)]
[TestCase("%!USERFIELD%", ExpectedResult = StringAfterNoEscaping)]
[TestCase("%%", ExpectedResult = "%%")]
[TestCase("/k echo %!USERNAME%", ExpectedResult = SampleCommandString)]
[TestCase("%COMSPEC%", ExpectedResult = @"C:\Windows\system32\cmd.exe")]
[TestCase("%UNSUPPORTEDPARAMETER%", ExpectedResult = "%UNSUPPORTEDPARAMETER%")]
public string ParserTest(string argumentString)
{
return _argumentParser.ParseArguments(argumentString);