Ejemplo n.º 1
0
        public void SetUp()
        {
            _decoder = Substitute.For <ITrackDecoding>();
            //Rigtige Klasser
            _uut    = new Logger();
            _Event  = new SeparationEvent();
            _Track1 = new TrackData()
            {
                Tag = "TAG1", X = 1000, Y = 2000, Altitude = 3000, Course = 30, Velocity = 23, FormattedTimestamp = "14-05-2018 17:18 53 1111"
            };
            _Track2 = new TrackData()
            {
                Tag = "TAG2", X = 1000, Y = 2000, Altitude = 3000, Course = 30, Velocity = 23, FormattedTimestamp = "14-05-2018 17:18 53 1111"
            };

            _Update = new Update(_decoder);
            //Lister

            _Tracklist = new List <ITracks>()
            {
                _Track1, _Track2
            };
            _fakeTransponderData = new TrackDataEventArgs(_Tracklist);

            //Substitueret
            _CalcDistance = Substitute.For <ICalcDistance>();
            _calcCourse   = Substitute.For <ICalcCourse>();
            _calcVelocity = Substitute.For <ICalcVelocity>();
            _monitor      = Substitute.For <IMonitors>();

            _decoder.TrackDataReadyForCalculation += (o, args) => _Tracklist = args.TrackData;
        }
Ejemplo n.º 2
0
        public void Setup()
        {
            _receiver = Substitute.For <ITransponderReceiver>();
            _uut      = new Decoding(_receiver);

            _fakeTransponderData = new RawTransponderDataEventArgs(new List <string>()
            {
                "TRK001;12345;67890;12000;20151014123456789"
            }
                                                                   );

            // Make a fake subscriber to the event in UUT
            _uut.TrackDataReady += (o, args) => receivedTrackData = args.TrackData;
        }
Ejemplo n.º 3
0
        public void SetUp()
        {
            _decoder = Substitute.For <ITrackDecoding>();
            //Rigtige Klasser
            _Track1 = new TrackData()
            {
                Tag = "TAG1", X = 10000, Y = 21000, Altitude = 3000, Course = 0, Velocity = 100, FormattedTimestamp = "14-05-2018 17:18 53 4000"
            };
            _Track2 = new TrackData()
            {
                Tag = "TAG1", X = 50000, Y = 20000, Altitude = 3000, Course = 0, Velocity = 100, FormattedTimestamp = "14-05-2018 17:18 53 1111"
            };
            _Track3 = new TrackData()
            {
                Tag = "TAG1", X = 100, Y = 21000, Altitude = 3000, Course = 0, Velocity = 100, FormattedTimestamp = "14-05-2018 17:18 53 4000"
            };
            _CalcDistance = new CalcDistance();
            _calcCourse   = new CalcCourse();
            _calcVelocity = new CalcVelocity();
            _monitor      = new Monitor();


            _uut = new Update(_decoder);
            //Lister

            _Tracklist = new List <ITracks>()
            {
                _Track1, _Track2
            };
            _fakeTransponderData = new TrackDataEventArgs(_Tracklist);

            //Substitueret
            _logger     = Substitute.For <ILog>();
            _output     = Substitute.For <IOutput>();
            _print      = Substitute.For <IPrints>();
            _Separation = Substitute.For <ISeparation>();


            _decoder.TrackDataReadyForCalculation += (o, args) => _Tracklist = args.TrackData;
        }
Ejemplo n.º 4
0
        public void Setup()
        {
            _track1           = Substitute.For <ITracks>();
            _track2           = Substitute.For <ITracks>();
            _decoder          = Substitute.For <ITrackDecoding>();
            receivedTrackData = new List <ITracks>();
            _uut          = new Update(_decoder);
            _calcDistance = Substitute.For <ICalcDistance>();
            _calcCourse   = Substitute.For <ICalcCourse>();
            _calcVelocity = Substitute.For <ICalcVelocity>();
            _logger       = Substitute.For <ILog>();
            _separation   = Substitute.For <ISeparation>();
            _monitor      = Substitute.For <IMonitors>();

            //Tilsæt ny data
            _track1.Tag      = "Tag1";
            _track1.Altitude = 500;
            _track1.X        = 20000;
            _track1.Y        = 40000;
            //_track1.Course = 0;
            _track1.Timestamp = new DateTime(20180419152929150);
            //_track1.Velocity = 0;

            _track2.Tag      = "Tag1";
            _track2.Altitude = 600;
            _track2.X        = 40000;
            _track2.Y        = 90000;
            //_track2.Course = 0;
            _track2.Timestamp = new DateTime(20180419152929100);
            //_track2.Velocity = 0;

            _fakeTransponderData = new TrackDataEventArgs(new List <ITracks>());
            _fakeTransponderData.TrackData.Add(Substitute.For <ITracks>());
            _fakeTransponderData.TrackData.Add(Substitute.For <ITracks>());
            //Her bliver eventet sat til at være lige med receivedTrackData
            _decoder.TrackDataReadyForCalculation += (o, args) => receivedTrackData = args.TrackData;
        }
Ejemplo n.º 5
0
 public Update(ITrackDecoding arg)
 {
     OldTracklist = new List <ITracks>();
     arg.TrackDataReadyForCalculation += ArgOnTrackDataReadyForCalculation;
 }