コード例 #1
0
        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"));
        }
コード例 #2
0
        public void Run()
        {
            var service = XrmCommand.GetService();

            var core  = new DuplicateRuleService(service);
            var rules = core.RetrievePublishedRules();

            core.StorePublishedRules(rules, WorkingDirectory);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
 public void Stores_Rules_Throws_If_Directory_IsEmpty()
 {
     DuplicateRuleService.StorePublishedRules(Guids, "");
 }