public void Create_WithNormCaseOption_CreatesPathAndNormalizesCase() { const string part1 = "C:\\TmP"; var factory = new PurePathFactory(); var expected = (IsWindows ? (IPurePath)new PureWindowsPath(part1) : new PurePosixPath(part1)).NormCase(); var actual = factory.Create(part1); Assert.AreEqual(expected, actual); }
public void Create_FromOnePath_CreatesPath() { const string part1 = "C:\\tmp"; var factory = new PurePathFactory(); var expected = IsWindows ? (IPurePath)new PureWindowsPath(part1) : new PurePosixPath(part1); var actual = factory.Create(part1); Assert.AreEqual(expected, actual); }
public void Create_WithNormCaseOption_CreatesPathAndNormalizesCase() { const string part1 = "C:\\TmP"; var factory = new PurePathFactory(); var expected = (IsWindows ? (IPurePath) new PureWindowsPath(part1) : new PurePosixPath(part1)).NormCase(); var actual = factory.Create(part1); Assert.AreEqual(expected, actual); }
public void Create_FromOnePath_CreatesPath() { const string part1 = "C:\\tmp"; var factory = new PurePathFactory(); var expected = IsWindows ? (IPurePath) new PureWindowsPath(part1) : new PurePosixPath(part1); var actual = factory.Create(part1); Assert.AreEqual(expected, actual); }
public void Create_FromMultiplePaths_CreatesPath() { var part1 = IsWindows ? "C:\\" : "C:/"; const string part2 = "tmp"; var factory = new PurePathFactory(); var expected = IsWindows ? (IPurePath) new PureWindowsPath(part1, part2) : new PurePosixPath(part1, part2); var actual = factory.Create(part1, part2); Assert.Equal(expected, actual); }
/// <summary> /// Factory method to create a new <see cref="PurePath"/> instance /// based upon the current operating system. /// </summary> /// <param name="paths"></param> /// <returns></returns> public static IPurePath Create(params string[] paths) { return(Factory.Create(FactoryOptions, paths)); }