예제 #1
0
        public void Test__Constructor__Nested()
        {
            IBasicLogger  logger2   = Substitute.For <IBasicLogger>();
            PatchProgress progress2 = new PatchProgress(progress, logger2);

            Assert.Same(progress.Counter, progress2.Counter);

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

            IProtoUrlConfig original = Substitute.For <IProtoUrlConfig>();

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

            progress2.ApplyingUpdate(original, patch1);
            Assert.Equal(1, progress.Counter.patchedNodes);
            logger.AssertNoLog();
            logger2.AssertInfo("Applying update ghi/jkl/@SOME_NODE to abc/def.cfg/SOME_NODE");
        }