public void Schema() { var pm = new PatternMatchingTableCustomizer(); pm.AddPattern("apple", null, null, null, true, null, null); Assert.IsTrue(pm.ShouldSkip(new SchemaAndTableName("apple", "anything"))); Assert.IsFalse(pm.ShouldSkip(new SchemaAndTableName("horus", "apple"))); }
public void StartsWith() { var pm = new PatternMatchingTableCustomizer(); pm.AddPattern(null, "A*", null, null, true, null, null); Assert.IsTrue(pm.ShouldSkip("A")); Assert.IsTrue(pm.ShouldSkip("Aaa")); Assert.IsTrue(pm.ShouldSkip("Abb")); Assert.IsFalse(pm.ShouldSkip("B")); Assert.IsFalse(pm.ShouldSkip("Baa")); Assert.IsFalse(pm.ShouldSkip("Bbb")); }
public void Schema_and_Table_Except_WildCard() { var pm = new PatternMatchingTableCustomizer(); pm.AddPattern("horus*", "apple*", "horusExcept*", "appleExcept*", true, null, null); Assert.IsFalse(pm.ShouldSkip(new SchemaAndTableName("apple", "anything"))); Assert.IsTrue(pm.ShouldSkip(new SchemaAndTableName("horus", "apple"))); Assert.IsFalse(pm.ShouldSkip(new SchemaAndTableName("horus", "horus"))); Assert.IsFalse(pm.ShouldSkip(new SchemaAndTableName("horusExcept1", "nothing"))); Assert.IsFalse(pm.ShouldSkip(new SchemaAndTableName("horusExcept", "appleExcept"))); Assert.IsFalse(pm.ShouldSkip(new SchemaAndTableName("horusExcept1", "appleExcept1"))); Assert.IsFalse(pm.ShouldSkip(new SchemaAndTableName("horusExcept2", "appleExcept2"))); }
public void Contains() { var pm = new PatternMatchingTableCustomizer(); pm.AddPattern(null, "*apple*", null, null, true, null, null); Assert.IsTrue(pm.ShouldSkip("xapplex")); Assert.IsTrue(pm.ShouldSkip("apple")); Assert.IsTrue(pm.ShouldSkip("applex")); Assert.IsTrue(pm.ShouldSkip("The quick brown fox jumps over the lazy apple dog")); Assert.IsFalse(pm.ShouldSkip("appl")); Assert.IsFalse(pm.ShouldSkip("pple")); Assert.IsFalse(pm.ShouldSkip("xxx")); }
public void Dot_and_Star() { var pm = new PatternMatchingTableCustomizer(); pm.AddPattern(null, "ap?le*", null, null, true, null, null); Assert.IsTrue(pm.ShouldSkip("apple")); Assert.IsTrue(pm.ShouldSkip("apxle")); Assert.IsFalse(pm.ShouldSkip("The quick brown fox jumps over the lazy apXle dog")); Assert.IsTrue(pm.ShouldSkip("apXle The quick brown fox jumps over the lazy dog")); Assert.IsFalse(pm.ShouldSkip("appl")); Assert.IsFalse(pm.ShouldSkip("pple")); Assert.IsFalse(pm.ShouldSkip("xxx")); }
public void Schema_and_Table_WildCard_Category() { var pm = new PatternMatchingTableCustomizer(); pm.AddPattern("horus*", "apple*", "horusExcept*", "appleExcept*", false, "category", null); Assert.AreEqual(null, pm.Category(new SchemaAndTableName("apple", "anything"))); Assert.AreEqual("category", pm.Category(new SchemaAndTableName("horus", "apple"))); Assert.AreEqual(null, pm.Category(new SchemaAndTableName("horus", "horus"))); Assert.AreEqual(null, pm.Category(new SchemaAndTableName("horusExcept1", "nothing"))); Assert.AreEqual(null, pm.Category(new SchemaAndTableName("horusExcept", "appleExcept"))); Assert.AreEqual(null, pm.Category(new SchemaAndTableName("horusExcept1", "appleExcept1"))); Assert.AreEqual(null, pm.Category(new SchemaAndTableName("horusExcept2", "appleExcept2"))); }