private static StringCalculator GetStringCalculator(FakeLogger stubWriter, FakeWebService mockWebService) { var sc = new StringCalculator(new FakeSettings {WillStringCalculatorBeEnabled = true}, stubWriter, mockWebService); return sc; }
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); }