Example #1
0
        public void Analyze_TooShortFileName_CallLogger()
        {
            ILogger logger = Substitute.For<ILogger>();

            LogAnalyzer analyzer = new LogAnalyzer(logger);

            analyzer.MinNameLength = 6;
            analyzer.Analyze("a.txt");

               logger.Received().LogError("Filename too short: a.txt");
        }
Example #2
0
        public void Analyze_TooShortFileName_CallLoggerArgMatchers()
        {
            ILogger logger = Substitute.For<ILogger>();

            LogAnalyzer analyzer = new LogAnalyzer(logger);

            analyzer.MinNameLength = 6;
            analyzer.Analyze("a.txt");

               logger.Received().LogError(Arg.Is<string>(s => s.Contains("too short")));
        }
Example #3
0
        public void Analyze_TooShortFileName_CallLogger()
        {
            FakeLogger logger = new FakeLogger();

            LogAnalyzer analyzer = new LogAnalyzer(logger);

            analyzer.MinNameLength= 6;
            analyzer.Analyze("a.txt");

            StringAssert.Contains("too short",logger.LastError);
        }