Esempio n. 1
0
        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());
        }
Esempio n. 2
0
        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());
        }
Esempio n. 3
0
 public TrafficLightService(IDigitReader digitReader)
 {
     _digitReader = digitReader;
 }
Esempio n. 4
0
 public TrafficLightService(IDigitReader digitReader)
 {
     _digitReader = digitReader;
 }