public void Stores_Rules_As_Json_In_Directory() { Assert.IsFalse(FileManager.FileSystem.File.Exists(@"C:\MyGuids\PublishedDuplicateDetectionRules.json")); DuplicateRuleService.StorePublishedRules(Guids, @"C:\MyGuids"); Assert.IsTrue(FileManager.FileSystem.File.Exists(@"C:\MyGuids\PublishedDuplicateDetectionRules.json")); }
public void Run() { var service = XrmCommand.GetService(); var core = new DuplicateRuleService(service); var rules = core.RetrievePublishedRules(); core.StorePublishedRules(rules, WorkingDirectory); }
public void Gets_Rules_Formatted_From_Directory() { var directory = @"C:\MyGuids"; DuplicateRuleService.StorePublishedRules(Guids, directory); Assert.IsTrue(FileManager.FileSystem.File.Exists(@"C:\MyGuids\PublishedDuplicateDetectionRules.json")); var rules = DuplicateRuleService.GetRulesFromConfig(directory); CollectionAssert.AreEqual(Guids, rules); }
public void Stores_Rules_Throws_If_Directory_IsEmpty() { DuplicateRuleService.StorePublishedRules(Guids, ""); }