public void SetUp()
        {
            Mock <DetectDelimitersService>      mockDelimiterService             = new Mock <DetectDelimitersService>();
            Mock <DetectNegativeNumbersService> mockDetectNegativeNumbersService = new Mock <DetectNegativeNumbersService>();
            Mock <ValidateNumberService>        mockValidateNumberService        = new Mock <ValidateNumberService>();
            Mock <CleanedNumberStringService>   mockCleanedNumberStringService   = new Mock <CleanedNumberStringService>();

            _stringCalculatorMainApplication = new StringCalculatorMainApplication(mockValidateNumberService.Object, mockCleanedNumberStringService.Object,
                                                                                   mockDelimiterService.Object, mockDetectNegativeNumbersService.Object);
        }
Esempio n. 2
0
 //Dependency Injection(DI) patterns are all about removing dependencies from your code.
 static void Main(string[] args) =>
 _ = new StringCalculatorMainApplication(new ValidateNumberService(), new CleanedNumberStringService(), new DetectDelimitersService(), new DetectNegativeNumbersService());