Exemplo n.º 1
0
        public void TimestampFormatter_NumberOfMonthConverts_ReturnsFormattedOutput(string number, string month)
        {
            // Define expected time stamp
            string expectedTimestamp = $"{month} 11th, 2018, at 11:11:11 and 111 milliseconds";

            // Only the month will be changed, check equal
            _uut.Unformatted = $"2018{number}11111111111";

            _uut.FormatTimestamp();

            Assert.AreEqual(expectedTimestamp, _uut.InPretty);
        }
Exemplo n.º 2
0
        private void CreateTrack(object sender, RawTransponderDataEventArgs rawTransponderDataEventArgs)
        {
            TrackList.Clear();
            //Traverse all elements
            foreach (var data in rawTransponderDataEventArgs.TransponderData)
            {
                // Distribute data to relevant classes

                _flightHandler.Extract(_parser.Parse(data));

                // If inside the monitored area
                if (_monitoredArea.InsideMonitoredArea(_flightHandler.Position))
                {
                    // Format and return the date
                    _formatter.Unformatted = _flightHandler.RawTimestamp;
                    _formatter.FormatTimestamp();

                    Position pos = new Position(_flightHandler.Position.XCoor, _flightHandler.Position.YCoor,
                                                _flightHandler.Position.Altitude);

                    TrackList.Add(new TrackObject(_flightHandler.Tag, pos,
                                                  _formatter.InPretty, _formatter.InDateTime));
                }
            }

            if (TrackList.Count != 0)
            {
                OnTrackListReady(new TrackListUpdatedArgs(TrackList));
            }
        }