Exemple #1
0
 public void Setup()
 {
     _testPlanes = new List <FlightData>();
     _fakeAirspacePlaneDetector = Substitute.For <IAirSpacePlaneDetector>();
     _fakeLogger = Substitute.For <ILogger>();
     _uut        = new CollisionDetector(_fakeAirspacePlaneDetector);
     _uut.logger = _fakeLogger;
 }
        public void Setup()
        {
            _fakeAirSpacePlaneDetector = Substitute.For <IAirSpacePlaneDetector>();
            _fakeRenderer = Substitute.For <IRenderer>();
            _uut          = new FlightDataController(_fakeAirSpacePlaneDetector);
            _uut.render   = _fakeRenderer;
            _testPlanes   = new List <FlightData>();


            // ListController Called ONCE so that flightDataList.Count > 0;
            // Otherwise the Calculator and Renderer wont be called
            FlightData F1 = new FlightData("1");

            F1.SetFlightData(8000, 8000, 8000, new DateTime());
            _testPlanes.Add(F1);
            _uut.ListController(new object(), new PlaneDetectorEventArgs()
            {
                PlanesInAirspace = _testPlanes
            });
        }
 public FlightDataController(IAirSpacePlaneDetector airSpacePlaneDetector)
 {
     this.airSpacePlaneDecOBJ = airSpacePlaneDetector;
     this.airSpacePlaneDecOBJ.AirplaneDetected += ListController; // Subscribes to the vent from AirSpacePlaneDetector
 }
 public CollisionDetector(IAirSpacePlaneDetector airSpacePlaneDetector)
 {
     this._airSpacePlaneDetector = airSpacePlaneDetector;
     this._airSpacePlaneDetector.AirplaneDetected += OnPlaneDetectorEvent;
 }