Ejemplo n.º 1
0
        public void TestError()
        {
            Assert.Equal(0, progress.Counter.errors);

            progress.Error("An error message no one is going to read");
            Assert.Equal(1, progress.Counter.errors);

            progress.Error("Maybe someone will read this one");
            Assert.Equal(2, progress.Counter.errors);
        }
        public void TestError()
        {
            UrlDir.UrlConfig config1 = UrlBuilder.CreateConfig("abc/def", new ConfigNode("SOME_NODE"));
            UrlDir.UrlConfig config2 = UrlBuilder.CreateConfig("abc/def", new ConfigNode("SOME_OTHER_NODE"));

            Assert.Equal(0, progress.Counter.errors);
            Assert.False(progress.Counter.errorFiles.ContainsKey("abc/def.cfg"));

            progress.Error(config1, "An error message no one is going to read");
            Assert.Equal(1, progress.Counter.errors);
            Assert.Equal(1, progress.Counter.errorFiles["abc/def.cfg"]);
            logger.Received().Log(LogType.Error, "An error message no one is going to read");

            progress.Error(config2, "Maybe someone will read this one");
            Assert.Equal(2, progress.Counter.errors);
            Assert.Equal(2, progress.Counter.errorFiles["abc/def.cfg"]);
            logger.Received().Log(LogType.Error, "Maybe someone will read this one");
        }