コード例 #1
0
 public void Setup()
 {
     _separationPrinter = Substitute.For <IPrinter>();
     _plane1            = new Plane();
     _plane2            = new Plane();
     _plane3            = new Plane();
     _uut = new CollisionWarner(_separationPrinter);
 }
コード例 #2
0
        public static int Main(string[] args)
        {
            ATM airTrafficMonitor = new ATM(new AreaMonitorPrinter(),
                                            new VelocityCalculator(), new HeadingCalculator());

            CollisionWarner separationWarningSystem = new CollisionWarner(new SeparationPrinter());

            // Using the real transponder data receiver
            var receiver = TransponderReceiverFactory.CreateTransponderDataReceiver();

            AreaMonitor areaMonitorReceiver = new AreaMonitor(new DataHandler(receiver));

            areaMonitorReceiver.Attach(airTrafficMonitor);
            areaMonitorReceiver.Attach(separationWarningSystem);
            while (true)
            {
                Thread.Sleep(1000);
            }
        }