public void GenerateOutput_WhenGetResultOfCalculation()
        {
            StringCalculatorWithColaborators stringCalculator = AStringCalculatorWithColaborators
                                                                .With(_outputMock);

            stringCalculator.Add("1,2,3");

            _outputMock.Verify(output => output.Write("6"));
        }
        public void LogResult(string numbers, string expectedResult)
        {
            StringCalculatorWithColaborators stringCalculatorWithColaborators = AStringCalculatorWithColaborators
                                                                                .With(_loggerMock);

            stringCalculatorWithColaborators.Add(numbers);

            _loggerMock.Verify(logger => logger.Write(expectedResult));
        }
        public void NotifyWebService_WhenLoggerTrowsException()
        {
            StringCalculatorWithColaborators stringCalculatorWithColaborators = AStringCalculatorWithColaborators
                                                                                .With(_webServiceMock)
                                                                                .With(_loggerMock)
                                                                                .ThatThrowsExceptionWithMessage("exception");

            stringCalculatorWithColaborators.Add("1,2,3");

            _webServiceMock.Verify(webService => webService.Notify("exception"));
        }