public void SetUp() { fakeCheckPlanes = Substitute.For <ICheckPlanes>(); uut = new Airspace(fakeCheckPlanes); fakePlanes = new List <IPlane>(); fakeILeaveEvent = Substitute.For <ILeaveEvent>(); receivedData = new LeaveEventArgs.Msg(); nEventsReceived = 0; CheckPlanes.ListOfTags = new List <string>(); time1 = new DateTime(2010, 10, 10, 00, 01, 00); fakePlane = new Plane(); fakePlane.XCoordinate = 20000; fakePlane.YCoordinate = 42000; fakePlane.Altitude = 900; fakePlane.Tag = "MarkusFriis"; fakePlanes.Add(fakePlane); fakeILeaveEvent.RaisedLeaveEvent += (o, args) => { receivedData = args.Message; ++nEventsReceived; }; }
public void Setup() { fakeDetectSeparationEvent = Substitute.For <IDetectSeparationEvent>(); fakeAirspace = Substitute.For <IAirspace>(); fakeCheckPlanes = Substitute.For <ICheckPlanes>(); uut = new Log(fakeDetectSeparationEvent, fakeAirspace, fakeCheckPlanes); uut.ClearLog(); }
public Renedition(IDetectSeparationEvent detectSep, ICheckPlanes detectEnter, IAirspace detectLeave) { DetectSep = detectSep; DetectSep.RaisedSerparationEvent += HandleSeparationEvent; DetectEnter = detectEnter; DetectEnter.RaisedEnterEvent += HandelEnterEvent; DetectLeave = detectLeave; DetectLeave.RaisedLeaveEvent += HandleLeaveEvent; }
public void SetUp() { fakeDetectSeparationEvent = Substitute.For <IDetectSeparationEvent>(); uut = new Renedition(); testPlane = Substitute.For <IPlane>(); testPlane2 = Substitute.For <IPlane>(); fakeCheckPlanes = Substitute.For <ICheckPlanes>(); fakeAirspace = Substitute.For <IAirspace>(); nEventsReceived = 0; receivedData = new EnterEventArgs.Msg(); testPlane = new Plane() { Course = 0, Altitude = 14000, Tag = "ATR423", XCoordinate = 39045, YCoordinate = 12932, Velocity = 0, TimeStamp = DateTime.ParseExact("20151006123456789", "yyyyMMddHHmmssfff", CultureInfo.InvariantCulture) }; testPlane2 = new Plane() { Course = 0, Altitude = 15000, Tag = "BRW500", XCoordinate = 30000, YCoordinate = 10000, Velocity = 0, TimeStamp = DateTime.ParseExact("20181006123456789", "yyyyMMddHHmmssfff", CultureInfo.InvariantCulture) }; listOPlanes = new List <IPlane>(); listOPlanes.Add(testPlane); fakeCheckPlanes.RaisedEnterEvent += (o, args) => { receivedData = args.Message; ++nEventsReceived; }; fakeAirspace.RaisedLeaveEvent += (o, args) => { receivedData2 = args.Message; ++nEventsReceived; }; }
public Log(IDetectSeparationEvent detectSepEvent, IAirspace detectLeaveEvent, ICheckPlanes detectEnterEvent) { IDetectSeparationEvent DetectSepEvent; DetectSepEvent = detectSepEvent; DetectSepEvent.RaisedSerparationEvent += WriteSeperationToLog; IAirspace DetectLeaveEvent; DetectLeaveEvent = detectLeaveEvent; DetectLeaveEvent.RaisedLeaveEvent += WriteLeavingPlaneToLog; ICheckPlanes DetectEnterEvent; DetectEnterEvent = detectEnterEvent; DetectEnterEvent.RaisedEnterEvent += WriteEnteredPlaneToLog; }
public void SetUp() { receivedData = new EnterEventArgs.Msg(); nEventsReceived = 0; newfakePlanes = new List <IPlane>(); currentfakePlanes = new List <IPlane>(); time1 = new DateTime(2010, 10, 10, 00, 01, 00); time2 = new DateTime(2010, 10, 10, 00, 02, 00); fakePlane1 = new Plane(); fakePlane1.Tag = "ABC123"; fakePlane1.XCoordinate = 1000; fakePlane1.YCoordinate = 1000; fakePlane1.Altitude = 17100; fakePlane1.TimeStamp = time1; currentfakePlanes.Add(fakePlane1); fakeCalculateCourse = Substitute.For <ICalculateCourse>(); fakeCalculateVelocity = Substitute.For <ICalculateVelocity>(); fakeRenedition = Substitute.For <IRenedition>(); fakeIEnterEvent = Substitute.For <IEnterEvent>(); uut = new CheckPlanes(fakeCalculateVelocity, fakeCalculateCourse, fakeRenedition); fakeListOfTags = CheckPlanes.ListOfTags; fakeIEnterEvent.RaisedEnterEvent += (o, args) => { receivedData = args.Message; ++nEventsReceived; }; }
public Airspace(ICheckPlanes cp) { _cp = cp; }