Exemple #1
0
        public void Analyze_LoggerThrows_CallsWebService()
        {
           FakeWebService mockWebService = new FakeWebService();

           FakeLogger2 stubLogger = new FakeLogger2();
           stubLogger.WillThrow = new Exception("fake exception");

            LogAnalyzer2 analyzer2 = new LogAnalyzer2(stubLogger, mockWebService);
                 analyzer2.MinNameLength = 8;
        
            string tooShortFileName="abc.ext";
            analyzer2.Analyze(tooShortFileName);

            Assert.That(mockWebService.MessageToWebService,
                            Is.StringContaining("fake exception"));
        }
Exemple #2
0
        public void Analyze_LoggerThrows_CallsWebService()
        {
            FakeWebService mockWebService = new FakeWebService();
            FakeLogger2    stubLogger     = new FakeLogger2();

            stubLogger.WillThrow = new Exception("fake exception");
            LogAnalyzer2 analyzer2 = new LogAnalyzer2(stubLogger, mockWebService);

            analyzer2.MinNameLength = 8;
            string tooShortFileName = "abc.ext";

            analyzer2.Analyze(tooShortFileName);

            Assert.That(mockWebService.MessageToWebService,
                        Does.Contain("fake exception"));
        }