public void DetectSeparation_TwoTracksCausingSeparation_LoggerUsed() { //Arrange var trackOne = new Track("one", _point, new DateTime(2000, 12, 31, 23, 59, 59)); var trackTwo = new Track("two", _point, new DateTime(2000, 12, 31, 23, 59, 59)); var trackList = new List <ITrack>(); trackList.Add(trackOne); trackList.Add(trackTwo); var args = new EventTracks(trackList); //Act _update.TracksUpdated += Raise.EventWith(args); //Assert _logger.Received().Log("one;two;" + new DateTime(2000, 12, 31, 23, 59, 59)); }
public void SeparationDetector_TransponderDataTwice_SeparationsCorrect_LoggerCalled(string trackOne, string trackTwo, string trackOneUD, string trackTwoUD) { //Arrange string trackOneTag = trackOne.Split(';')[0]; string trackTwoTag = trackTwo.Split(';')[0]; DateTime trackOneTimeStamp = DateTime.ParseExact(trackOne.Split(';')[4], "yyyyMMddHHmmssfff", null); var transponderData = new List <string>(); var track1 = trackOne; var track2 = trackTwo; transponderData.Add(track1); transponderData.Add(track2); var transponderDataEventArgs = new RawTransponderDataEventArgs(transponderData); //Act _transponderReceiver.TransponderDataReady += Raise.EventWith(transponderDataEventArgs); //Assert Assert.That(_separationList.Count(), Is.EqualTo(1)); Assert.That(_separationList[0].Tag1, Is.EqualTo(trackOneTag)); Assert.That(_separationList[0].Tag2, Is.EqualTo(trackTwoTag)); Assert.That(_nEventReceived, Is.EqualTo(1)); _logger.Received(1).Log(trackOneTag + ";" + trackTwoTag + ";" + trackOneTimeStamp); //Re-Arrange transponderData = new List <string>(); track1 = trackOneUD; track2 = trackTwoUD; transponderData.Add(track1); transponderData.Add(track2); transponderDataEventArgs = new RawTransponderDataEventArgs(transponderData); //Act Again _transponderReceiver.TransponderDataReady += Raise.EventWith(transponderDataEventArgs); //Assert Again Assert.That(_nEventReceived, Is.EqualTo(2)); Assert.That(_separationList.Count(), Is.EqualTo(0)); }