public void Equals() { sanitized = new SanitizedPath("C:/lua"); var other = new SanitizedPath(@"C:\lua"); Assert.IsTrue(sanitized.Equals(other)); }
public SourceCode(string fileName, string baseDirectory, string contents) { FileName = new SanitizedPath(fileName); BaseDirectory = new SanitizedPath(baseDirectory); contents = Regex.Replace(contents, "\r\n?", "\n"); Contents = contents; Library = Library.Shared; }
public void GetRelativeName() { sanitized = new SanitizedPath(@"C:\lua\Weapons\Shotgun.lua"); ISanitizedPath baseDirectory = new SanitizedPath(@"C:\lua"); string relativeName = sanitized.GetRelativeName(baseDirectory); Assert.AreEqual(@"lua/Weapons/Shotgun.lua", relativeName); }
public void GetRelativeName_Passing_a_null_argument_throws_an_exception() { sanitized = new SanitizedPath(@"C:\lua\Weapons\Shotgun.lua"); TestDelegate test = delegate { sanitized.GetRelativeName(null); }; Assert.Throws<ArgumentNullException>(test); }
public void SetPath_UnixPathSeparators() { sanitized = new SanitizedPath("C:/lua"); Assert.AreEqual(@"C:\lua", sanitized.Path, @"Convert '/' separators to '\'."); }
public void SetPath_TrailingSeparator() { sanitized = new SanitizedPath(@"C:\lua\"); Assert.AreEqual(@"C:\lua", sanitized.Path, "Remove trailing separators."); }
public void SetPath_Null() { sanitized = new SanitizedPath(); Assert.IsNull(sanitized.Path); }
public void SetPath_FileName() { sanitized = new SanitizedPath(@"C:\lua\Weapons\Shotgun.lua"); Assert.AreEqual(@"C:\lua\Weapons\Shotgun.lua", sanitized.Path); }
public void SetPath() { sanitized = new SanitizedPath(@"C:\lua"); Assert.AreEqual(@"C:\lua", sanitized.Path); }
public void SetUncleanPath() { sanitized = new SanitizedPath(); sanitized.UncleanPath = "C:/lua/"; Assert.AreEqual("C:/lua/", sanitized.UncleanPath); Assert.AreEqual(@"C:\lua", sanitized.Path); }