public void Exporters_XrefExporter_isFlagNeeded() { Document parent = new Document("DOC122", null, null, new Dictionary <string, string>() { { "TEST", "abc123" } }, null); Document doc = new Document("DOC123", parent, null, new Dictionary <string, string>() { { "TEST", "XYZ321" } }, null); Trigger trigger = new Trigger(); trigger.Type = Switch.SwitchType.None; TestExporter exporter = new TestExporter(); Assert.IsFalse(exporter.isFlagNeeded(doc, trigger.ToSwitch(), parent)); trigger.Type = Switch.SwitchType.Family; Assert.IsTrue(exporter.isFlagNeeded(parent, trigger.ToSwitch(), null)); Assert.IsFalse(exporter.isFlagNeeded(doc, trigger.ToSwitch(), parent)); trigger.Type = Switch.SwitchType.Regex; trigger.FieldName = "TEST"; trigger.RegexPattern = "[a-zA-Z]+\\d+"; Assert.IsTrue(exporter.isFlagNeeded(parent, trigger.ToSwitch(), null)); Assert.IsTrue(exporter.isFlagNeeded(doc, trigger.ToSwitch(), parent)); doc.Metadata["TEST"] = "123nope"; Assert.IsFalse(exporter.isFlagNeeded(doc, trigger.ToSwitch(), parent)); }