private static void TrackConverter_TrackObjectsReady(object sender, TrackObjectEventArgs e) { // lbxflyikonflikt.Items.Clear(); foreach (var track in e.TrackObjects) { // lbxflyikonflikt.Items.Add(track); } }
public void RaiseEvent() { var args = new TrackObjectEventArgs(new List <TrackObject> { trackobject }); trackconverter.TrackObjectsReady += Raise.EventWith(args); Assert.That(_nEventsRaised, Is.EqualTo(1)); }
public void noPriorTracks_newListOfCurrentTracks_ShowCurrentTracks() { _listOfTracks.Clear(); _listOfTracks.Add(_track1); _listOfTracks.Add(_track2); _fakeTrackArgs = new TrackObjectEventArgs(_listOfTracks); _sorter.TrackSortedReady += Raise.EventWith(_fakeTrackArgs); //_uut.HandleTrack(); }
private void _sorter_TrackSortedReady(object sender, TrackObjectEventArgs e) { currentTracks = e.TrackObjects; if (currentTracks.Count >= 1) { HandleTrack(); CheckTracks(currentTracks); } priorTracks = new List <TrackObject>(currentTracks); currentTracks = null; }
public void SetUp() { _transponderReceiver = Substitute.For <ITransponderReceiver>(); _uut = new TrackConverter(_transponderReceiver); info = new List <string>(); info.Add(input1); info.Add(input2); _nEventsRaised = 0; _uut.TrackObjectsReady += (o, args) => { ++_nEventsRaised; _receivedArgs = args; }; }
public void SetUp() { trackconverter = Substitute.For <Logic.Interfaces.ITrackConverter>(); _uut = new Logic.Handlers.Sorter(trackconverter); _tracks = new List <TrackObject>(); trackobject = new TrackObject("123", 12345, 12345, 1000, DateTime.ParseExact("20151006213456789", "yyyyMMddHHmmssfff", CultureInfo.InvariantCulture)); _tracks.Add(trackobject); _nEventsRaised = 0; _uut.TrackSortedReady += (o, args) => { ++_nEventsRaised; _receivedArgs = args; }; }
public void somePriorTracks_newListOfCurrentTracksSameTags_ShowCurrentTracks() { _listOfTracks.Clear(); _listOfTracks.Add(_track1); _listOfTracks.Add(_track2); _fakeTrackArgs = new TrackObjectEventArgs(_listOfTracks); _sorter.TrackSortedReady += Raise.EventWith(_fakeTrackArgs); _listOfTracks.Clear(); _track1 = new TrackObject("Tag123", 72000, 72000, 1000, DateTime.ParseExact("20180412111111111", "yyyyMMddHHmmssfff", CultureInfo.InvariantCulture)); _listOfTracks.Add(_track1); _listOfTracks.Add(_track2); _fakeTrackArgs = new TrackObjectEventArgs(_listOfTracks); _sorter.TrackSortedReady += Raise.EventWith(_fakeTrackArgs); }
public void SetUp() { _sorter = Substitute.For <ISorter>(); _speed = Substitute.For <ITrackSpeed>(); _compassCourse = Substitute.For <ITrackCompassCourse>(); _checker = Substitute.For <ISeperationEventChecker>(); _warningCreator = Substitute.For <ISeperationEventHandler>(); _logger = Substitute.For <ISeperationEventLogger>(); _uut = new Controller(_sorter, _speed, _compassCourse, _checker, _warningCreator, _logger); _sorter.TrackSortedReady += (o, args) => { _receivedArgs = args; }; _listOfTracks = new List <TrackObject>(); // Create tracks _track1 = new TrackObject("Tag123", 70000, 70000, 1000, DateTime.ParseExact("20180412111111111", "yyyyMMddHHmmssfff", CultureInfo.InvariantCulture)); _track2 = new TrackObject("Tag456", 68000, 68000, 800, DateTime.ParseExact("20180412111111111", "yyyyMMddHHmmssfff", CultureInfo.InvariantCulture)); _track3 = new TrackObject("Tag789", 89000, 89000, 5000, DateTime.ParseExact("20180412111111111", "yyyyMMddHHmmssfff", CultureInfo.InvariantCulture)); _track4 = new TrackObject("TagABC", 72000, 72000, 1200, DateTime.ParseExact("20180412111111111", "yyyyMMddHHmmssfff", CultureInfo.InvariantCulture)); }
public void OnTrackObjectListUpdated(TrackObjectEventArgs trackObjects) { var handler = TrackObjectsReady; handler?.Invoke(this, trackObjects); }