public void RelativePath_Unit_Append1_PathContainsAnotherSeparator() { String[] nodes = new String[] { "sites" }; Char separator = RelativePath.ForwardSlash; RelativePath target = new RelativePath(nodes, separator); String path = "Chad\\Greer"; target.Append(path); }
public void RelativePath_Unit_Append1_Optimal() { String[] nodes = new String[] { "sites" }; Char separator = RelativePath.ForwardSlash; RelativePath target = new RelativePath(nodes, separator); String path = "Chad/Greer"; RelativePath result = target.Append(path); Assert.AreEqual("sites", result.Nodes.ElementAt(0)); Assert.AreEqual("Chad", result.Nodes.ElementAt(1)); Assert.AreEqual("Greer", result.Nodes.ElementAt(2)); Assert.AreEqual(separator, result.Separator); }
public void RelativePath_Unit_Append1_PathIsEmpty() { String[] nodes = new String[] { "sites" }; Char separator = RelativePath.ForwardSlash; RelativePath target = new RelativePath(nodes, separator); String path = String.Empty; RelativePath result = target.Append(path); Assert.AreEqual(target.Nodes.Count(), result.Nodes.Count()); Assert.AreEqual("sites", result.Nodes.ElementAt(0)); Assert.AreEqual(separator, result.Separator); }
public void RelativePath_Unit_Append2_TargetHasEmptyLastNode() { String[] nodes = new String[] { "sites", String.Empty }; Char separator = RelativePath.ForwardSlash; RelativePath target = new RelativePath(nodes, separator, false); String path = "Chad/Greer"; Boolean normalizeSeparators = true; RelativePath result = target.Append(path, normalizeSeparators); Assert.AreEqual("sites", result.Nodes.ElementAt(0)); Assert.AreEqual("Chad", result.Nodes.ElementAt(1)); Assert.AreEqual("Greer", result.Nodes.ElementAt(2)); Assert.AreEqual(separator, result.Separator); }
public void RelativePath_Unit_Append2_PathIsWhiteSpace() { String[] nodes = new String[] { "sites" }; Char separator = RelativePath.ForwardSlash; RelativePath target = new RelativePath(nodes, separator); String path = " \t \r \n "; Boolean normalizeSeparators = true; RelativePath result = target.Append(path, normalizeSeparators); Assert.AreEqual(target.Nodes.Count(), result.Nodes.Count()); Assert.AreEqual("sites", result.Nodes.ElementAt(0)); Assert.AreEqual(separator, result.Separator); }
public void RelativePath_Unit_Append2_PathIsNull() { String[] nodes = new String[] { "sites" }; Char separator = RelativePath.ForwardSlash; RelativePath target = new RelativePath(nodes, separator); String path = null; Boolean normalizeSeparators = true; target.Append(path, normalizeSeparators); }
public void RelativePath_Unit_Append2_PathContainsConsecutiveSeparators() { String[] nodes = new String[] { "sites" }; Char separator = RelativePath.ForwardSlash; RelativePath target = new RelativePath(nodes, separator); String path = "Chad//Greer"; Boolean normalizeSeparators = true; target.Append(path, normalizeSeparators); }
public void RelativePath_Unit_Append2_PathContainsAnotherSeparator() { String[] nodes = new String[] { "sites" }; Char separator = RelativePath.ForwardSlash; RelativePath target = new RelativePath(nodes, separator); String path = "Chad\\Greer"; Boolean normalizeSeparators = true; RelativePath result = target.Append(path, normalizeSeparators); Assert.AreEqual("sites", result.Nodes.ElementAt(0)); Assert.AreEqual("Chad", result.Nodes.ElementAt(1)); Assert.AreEqual("Greer", result.Nodes.ElementAt(2)); Assert.AreEqual(separator, result.Separator); }
public void RelativePath_Unit_Append1_PathIsNull() { String[] nodes = new String[] { "sites" }; Char separator = RelativePath.ForwardSlash; RelativePath target = new RelativePath(nodes, separator); String path = null; target.Append(path); }