public void TesApplyingDelete()
        {
            UrlDir.UrlConfig original = UrlBuilder.CreateConfig("abc/def", new ConfigNode("SOME_NODE"));
            UrlDir.UrlConfig patch1   = UrlBuilder.CreateConfig("ghi/jkl", new ConfigNode("!SOME_NODE"));
            UrlDir.UrlConfig patch2   = UrlBuilder.CreateConfig("pqr/stu", new ConfigNode("!SOME_NODE"));

            Assert.Equal(0, progress.Counter.patchedNodes);

            progress.ApplyingDelete(original, patch1);
            Assert.Equal(1, progress.Counter.patchedNodes);
            logger.Received().Log(LogType.Log, "Applying delete ghi/jkl/!SOME_NODE to abc/def/SOME_NODE");

            progress.ApplyingDelete(original, patch2);
            Assert.Equal(2, progress.Counter.patchedNodes);
            logger.Received().Log(LogType.Log, "Applying delete pqr/stu/!SOME_NODE to abc/def/SOME_NODE");
        }
Пример #2
0
        public void TesApplyingDelete()
        {
            IProtoUrlConfig original = Substitute.For <IProtoUrlConfig>();

            original.FullUrl.Returns("abc/def.cfg/SOME_NODE");
            UrlDir.UrlConfig patch1 = UrlBuilder.CreateConfig("ghi/jkl", new ConfigNode("!SOME_NODE"));
            UrlDir.UrlConfig patch2 = UrlBuilder.CreateConfig("pqr/stu", new ConfigNode("!SOME_NODE"));

            Assert.Equal(0, progress.Counter.patchedNodes);

            progress.ApplyingDelete(original, patch1);
            Assert.Equal(1, progress.Counter.patchedNodes);
            logger.Received().Log(LogType.Log, "Applying delete ghi/jkl/!SOME_NODE to abc/def.cfg/SOME_NODE");

            progress.ApplyingDelete(original, patch2);
            Assert.Equal(2, progress.Counter.patchedNodes);
            logger.Received().Log(LogType.Log, "Applying delete pqr/stu/!SOME_NODE to abc/def.cfg/SOME_NODE");
        }