Example #1
0
        public void UpdatePlaneDataEventRecepientTest()
        {
            // Setup test data
            AirplanesList apl = new AirplanesList();
            AirplaneData  ap  = new AirplaneData("QUA537;20000;20000;20000;20191027221809363");

            apl.AirplaneDataList.Add(ap);

            // Act: Raise event med liste apl
            _fakeTransponderReceiverClient.AirplaneListReady += Raise.EventWith(apl);

            // Assert at opbjektet modtaget er lig objektet som vi raiser med
            Assert.That(_uut.AirplanesUpdated.ElementAt(0).Tag, Is.EqualTo("QUA537"));
        }
Example #2
0
        public void Setup()
        {
            // Make a fake Transponder Data Receiver
            _fakeTransponderReceiver = Substitute.For <ITransponderReceiver>();
            // Inject the fake TDR
            _uut = new TransponderReceiverClient(_fakeTransponderReceiver);

            _receivedEventArgs      = null;
            _uut.AirplaneListReady +=
                (o, args) =>
            {
                _receivedEventArgs = args;
            };
        }
Example #3
0
        public void UpdatedList_EventFired()
        {
            // Setup test data
            AirplanesList apl = new AirplanesList();

            AirplaneData ap        = new AirplaneData("QUA537;20500;20000;20000;20191027221819363");
            AirplaneData apUpdated = new AirplaneData("QUA537;21500;20000;20000;20191027221819363");

            _uut.AirplanesUpdated.Add(ap);
            apl.AirplaneDataList.Add(apUpdated);

            _uut.UpdatePlaneData(new object {}, apl);

            Assert.That(_receivedEventArgs, Is.Not.Null);
        }
Example #4
0
        public void UpdatePlaneDataEventRecepientCompareTest()
        {
            // Setup test data
            AirplanesList apl          = new AirplanesList();
            AirplaneData  plane        = new AirplaneData("QUA537;20000;20000;20000;20191027221809363");
            AirplaneData  planeUpdated = new AirplaneData("QUA537;20500;20000;20000;20191027221819363");

            apl.AirplaneDataList.Add(planeUpdated);
            _uut.AirplanesUpdated.Add(plane);

            // Act: Raise event med liste apl
            _fakeTransponderReceiverClient.AirplaneListReady += Raise.EventWith(apl);

            // Assert at opbjektet modtaget er lig objektet som vi raiser med
            Assert.That(_receivedEventArgs.Speed, Is.EqualTo(180));
        }
Example #5
0
 public void Setup()
 {
     _uut = new AirplanesList();
 }