public void Preprocess_Keeps_True_Value() { const string query = @" select * /* Utilitron.If: testFlag */ this text should not be removed /* Utilitron.EndIf */ from Bananas "; const string expected = @" select * /* Utilitron.If: testFlag */ this text should not be removed /* Utilitron.EndIf */ from Bananas "; var flags = new Dictionary <string, bool> { { "testFlag", true }, }; var result = QueryUtilities.Preprocess(flags, query); Assert.AreEqual(expected, result); }
public void Preprocess_Throws_InvlaidOperationException_If_Missing_Flag() { const string query = @" select * /* Utilitron.If: testFlag */ this text should not be removed /* Utilitron.EndIf */ from Bananas "; const string expected = @" select * /* Utilitron.If: testFlag */ this text should not be removed /* Utilitron.EndIf */ from Bananas "; var flags = new Dictionary <string, bool>(); var result = QueryUtilities.Preprocess(flags, query); Assert.AreEqual(expected, result); }