public void TestSetup() { _trackListEvent = Substitute.For <ITrackListEvent>(); _airspace = FakeAirspaceGenerator.GetAirspace(0, 0, 0); _uutValidateTransponderData = new ValidateTransponderData(ref _trackListEvent, _airspace); }
public void TestSetUp() { _validationCompleteEventArgs = null; _trackListEvent = Substitute.For <ITrackListEvent>(); // setup Airspace to work on _airspace = FakeAirspaceGenerator.GetAirspace(0, 0, 0); // set Validator to subscribe to Interpreter(done in constructor) _validateTransponderData = new ValidateTransponderData(ref _trackListEvent, _airspace); // setup listener _validateTransponderData.ValidationCompleteEventHandler += (sender, args) => { _validationCompleteEventArgs = args; }; }
static void setup() { tr = TransponderReceiverFactory.CreateTransponderDataReceiver(); TDInterpreter = new TransponderDataInterpreter(); TDInterpreter.subscribe(tr); Position p = new Position(); p.XCoordinate = 30000; p.YCoordinate = 30000; p.ZCoordinate = 5; airspace = new Airspace(); airspace.AirspacePosition = p; airspace.HorizontalSize = 100000; airspace.VerticalEnd = 100000; ITrackListEvent itlEvent = TDInterpreter; validator = new ValidateTransponderData(ref itlEvent, airspace); AirOutputter = new AirTrafficOutputter(); AirOutputter.TrafficController = new ConsoleAirTrafficController(); List <IConditionStrategy <ITrack> > conditionStrategies = new List <IConditionStrategy <ITrack> >(); conditionStrategies.Add(new TrackAltitudeCondition() { AltitudeRestriction = 100000 }); conditionStrategies.Add(new TrackHorizontalDistanceCondition() { HorizontalDistance = 100000 }); airCondDetector = new AirspaceTrackConditionDetector(conditionStrategies); TrackHorizontalDistanceCalculator HorizontalDistanceCalc = new TrackHorizontalDistanceCalculator(); TrackSpeedCalculator speedCalc = new TrackSpeedCalculator(HorizontalDistanceCalc); TrackCourseCalculator courseCalc = new TrackCourseCalculator(); AirspaceUpdater airUpdater = new AirspaceUpdater(speedCalc, courseCalc); Monitor = new AirTrafficMonitor(validator, airCondDetector, AirOutputter, airUpdater); FileLogger fl = new FileLogger(); fl.PathToFile = "../../log.txt"; AirOutputter.Logger = fl; }