示例#1
0
 private static StringCalculator GetStringCalculator(FakeLogger stubWriter, FakeWebService mockWebService)
 {
     var sc = new StringCalculator(new FakeSettings {WillStringCalculatorBeEnabled = true}, stubWriter, mockWebService);
     return sc;
 }
示例#2
0
        public void Add_WhenLoggerThrowsException_NotifyWebservice(string input)
        {
            var mockWebService = new FakeWebService();

            var stubWriter = new FakeLogger
            {
                WillThrow = new Exception("SomeMessage")
            };

            var sc = GetStringCalculator(stubWriter, mockWebService);

            sc.Add(input);

            StringAssert.Contains("SomeMessage", mockWebService.WriteMessage);
        }