Added more remote path transformation tests.

This commit is contained in:
Gert Driesen
2017-09-10 20:55:48 +02:00
parent b0db16bfdf
commit f8e1b8029a
2 changed files with 124 additions and 4 deletions
@@ -446,7 +446,7 @@ namespace Renci.SshNet.Tests.Classes
}
[TestMethod]
public void ExclamationMark_Embedded()
public void ExclamationMark_Embedded_Single()
{
const string path = "/var/garbage!/temp";
@@ -455,6 +455,16 @@ namespace Renci.SshNet.Tests.Classes
Assert.AreEqual("\"/var/garbage!/temp\"", actual);
}
[TestMethod]
public void ExclamationMark_Embedded_Sequence()
{
const string path = "/var/garbage!!/temp";
var actual = _transformation.Transform(path);
Assert.AreEqual("\"/var/garbage!!/temp\"", actual);
}
[TestMethod]
public void ExclamationMark_Leading()
{
@@ -886,7 +896,7 @@ namespace Renci.SshNet.Tests.Classes
}
[TestMethod]
public void SingleQuote_Embedded()
public void SingleQuote_Embedded_Single()
{
const string path = "Rain'Storm";
@@ -895,6 +905,16 @@ namespace Renci.SshNet.Tests.Classes
Assert.AreEqual("\"Rain'Storm\"", actual);
}
[TestMethod]
public void SingleQuote_Embedded_Sequence()
{
const string path = "Rain''Storm";
var actual = _transformation.Transform(path);
Assert.AreEqual("\"Rain''Storm\"", actual);
}
[TestMethod]
public void SingleQuote_Leading()
{
@@ -925,6 +945,46 @@ namespace Renci.SshNet.Tests.Classes
Assert.AreEqual("\"Time'\"", actual);
}
[TestMethod]
public void SingleQuoteAndExclamationMark_Embedded()
{
const string path = "Rain'!Storm";
var actual = _transformation.Transform(path);
Assert.AreEqual("\"Rain'!Storm\"", actual);
}
[TestMethod]
public void SingleQuoteAndExclamationMark_Leading()
{
const string path = "'!Rain";
var actual = _transformation.Transform(path);
Assert.AreEqual("\"'!Rain\"", actual);
}
[TestMethod]
public void SingleQuoteAndExclamationMark_LeadingAndTrailing()
{
const string path = "'!Rain'!";
var actual = _transformation.Transform(path);
Assert.AreEqual("\"'!Rain'!\"", actual);
}
[TestMethod]
public void SingleQuoteAndExclamationMark_Trailing()
{
const string path = "Rain'!";
var actual = _transformation.Transform(path);
Assert.AreEqual("\"Rain'!\"", actual);
}
[TestMethod]
public void Space_Embedded()
{
@@ -446,7 +446,7 @@ namespace Renci.SshNet.Tests.Classes
}
[TestMethod]
public void ExclamationMark_Embedded()
public void ExclamationMark_Embedded_Single()
{
const string path = "/var/garbage!/temp";
@@ -455,6 +455,16 @@ namespace Renci.SshNet.Tests.Classes
Assert.AreEqual("'/var/garbage'\\!'/temp'", actual);
}
[TestMethod]
public void ExclamationMark_Embedded_Sequence()
{
const string path = "/var/garbage!!/temp";
var actual = _transformation.Transform(path);
Assert.AreEqual("'/var/garbage'\\!\\!'/temp'", actual);
}
[TestMethod]
public void ExclamationMark_Leading()
{
@@ -886,7 +896,7 @@ namespace Renci.SshNet.Tests.Classes
}
[TestMethod]
public void SingleQuote_Embedded()
public void SingleQuote_Embedded_Single()
{
const string path = "Rain'Storm";
@@ -895,6 +905,16 @@ namespace Renci.SshNet.Tests.Classes
Assert.AreEqual("'Rain'\"'\"'Storm'", actual);
}
[TestMethod]
public void SingleQuote_Embedded_Sequence()
{
const string path = "Rain''Storm";
var actual = _transformation.Transform(path);
Assert.AreEqual("'Rain'\"''\"'Storm'", actual);
}
[TestMethod]
public void SingleQuote_Leading()
{
@@ -925,6 +945,46 @@ namespace Renci.SshNet.Tests.Classes
Assert.AreEqual("'Time'\"'\"", actual);
}
[TestMethod]
public void SingleQuoteAndExclamationMark_Embedded()
{
const string path = "Rain'!Storm";
var actual = _transformation.Transform(path);
Assert.AreEqual("'Rain'\"'\"\\!'Storm'", actual);
}
[TestMethod]
public void SingleQuoteAndExclamationMark_Leading()
{
const string path = "'!Rain";
var actual = _transformation.Transform(path);
Assert.AreEqual("\"'\"\\!'Rain'", actual);
}
[TestMethod]
public void SingleQuoteAndExclamationMark_LeadingAndTrailing()
{
const string path = "'!Rain'!";
var actual = _transformation.Transform(path);
Assert.AreEqual("\"'\"\\!'Rain'\"'\"\\!", actual);
}
[TestMethod]
public void SingleQuoteAndExclamationMark_Trailing()
{
const string path = "Rain'!";
var actual = _transformation.Transform(path);
Assert.AreEqual("'Rain'\"'\"\\!", actual);
}
[TestMethod]
public void Space_Embedded()
{