public void Clone() { var original = new IgnoreList(new string[] { "README1.txt", "README2.txt" }); var clone = original.Clone(); Assert.IsTrue(clone.IsIgnored("README1.txt", true)); Assert.IsTrue(clone.IsIgnored("README2.txt", true)); Assert.IsFalse(clone.IsIgnored("README3.txt", true)); }
public void Clone_Keeps_Match_Flags() { var original = new IgnoreList(new string[] { "README1.txt", "README2.txt" }, MatchFlags.PATHNAME | MatchFlags.CASEFOLD); original.AddRule("README3.txt", MatchFlags.NONE); var clone = original.Clone(); Assert.IsTrue(clone.Rules[0].MatchFlags == (MatchFlags.PATHNAME | MatchFlags.CASEFOLD)); Assert.IsTrue(clone.Rules[1].MatchFlags == (MatchFlags.PATHNAME | MatchFlags.CASEFOLD)); // Should use PATHNAME because we assign this internally if it's not set Assert.IsTrue(clone.Rules[2].MatchFlags == MatchFlags.PATHNAME); }