static void AnalyzeDigit(IDigitReader digitReader) { var trafficLightService = new TrafficLightService(digitReader); var filters = new List<INumberFilter> { new SequenceDigitFilter(), new MaskDigitFilter() }; var digitAnalyzer = new TrafficLightAnalyzer(trafficLightService, filters); var result = digitAnalyzer.Analyze(); Console.WriteLine("Right answer is {0}", digitReader.GetRightAnswer()); Console.WriteLine("Actual answer is {0} on step {1} after getting number {2}", result, digitReader.GetStep(), digitReader.GetLastNumber()); }
static void AnalyzeDigit(IDigitReader digitReader) { var trafficLightService = new TrafficLightService(digitReader); var filters = new List <INumberFilter> { new SequenceDigitFilter(), new MaskDigitFilter() }; var digitAnalyzer = new TrafficLightAnalyzer(trafficLightService, filters); var result = digitAnalyzer.Analyze(); Console.WriteLine("Right answer is {0}", digitReader.GetRightAnswer()); Console.WriteLine("Actual answer is {0} on step {1} after getting number {2}", result, digitReader.GetStep(), digitReader.GetLastNumber()); }
public TrafficLightService(IDigitReader digitReader) { _digitReader = digitReader; }