コード例 #1
0
        public void ShowAllFlights_ListOfTracksContainsOneElement_ConsoleLogInformationCalled()
        {
            var tracks = new List <ITrack>()
            {
                TrackFactory.CreateTestTrack()
            };

            _uut.ShowAllFlightsInAirspace(tracks);

            _console.Received(1).LogInformation(Arg.Any <string>());
        }
コード例 #2
0
        public void ShowSeparationCondition_ListOfTracksContainsOneElement_ConsoleLogInformationNotCalled()
        {
            var tracks = new List <ITrack>()
            {
                TrackFactory.CreateTestTrack()
            };

            _uut.ShowSeparationCondition(tracks);

            _console.DidNotReceive().LogInformation(Arg.Any <string>());
        }
コード例 #3
0
        public void ShowSeparationCondition_ListOfTracksContainsTwoElements_ConsoleLogErrorNotCalled()
        {
            var tracks = new List <ITrack>()
            {
                TrackFactory.CreateTestTrack(),
                TrackFactory.CreateTestTrack(),
            };

            _uut.ShowSeparationCondition(tracks);

            _console.DidNotReceive().LogError(Arg.Any <string>());
        }
コード例 #4
0
        public void ShowAllFlights_ListOfTracksContainsTenElements_ConsoleLogInformationCalled()
        {
            var tracks = new List <ITrack>();

            for (var i = 0; i < 10; i++)
            {
                tracks.Add(TrackFactory.CreateTestTrack());
            }

            _uut.ShowAllFlightsInAirspace(tracks);

            _console.Received(10).LogInformation(Arg.Any <string>());
        }
コード例 #5
0
        public void ShowSeparationCondition_ListOfTracksContainsTenElements_ConsoleLogInformationNotCalled()
        {
            var tracks = new List <ITrack>();

            for (var i = 0; i < 10; i++)
            {
                tracks.Add(TrackFactory.CreateTestTrack());
            }

            _uut.ShowSeparationCondition(tracks);

            _console.DidNotReceive().LogInformation(Arg.Any <string>());
        }
コード例 #6
0
        public void HandleSeparationWarningEvent_SeparationOccured_ListOfFlightsReceived()
        {
            var flightTracks = new List <ITrack>()
            {
                TrackFactory.CreateTestTrack(),
                TrackFactory.CreateTestTrack()
            };

            _separation.SeparationWarningEvent += Raise.EventWith(new SeparationWarningEventArg()
            {
                SeparationList = flightTracks
            });

            Assert.That(_separationWarningEventArg.SeparationList, Is.EqualTo(flightTracks));
        }
コード例 #7
0
        public void HandleSeparationWarningEvent_SeparationOccured_EventIsHandled()
        {
            var flightTracks = new List <ITrack>()
            {
                TrackFactory.CreateTestTrack(),
                TrackFactory.CreateTestTrack()
            };

            _separation.SeparationWarningEvent += Raise.EventWith(new SeparationWarningEventArg()
            {
                SeparationList = flightTracks
            });

            Assert.That(_eventHandled, Is.True);
        }
コード例 #8
0
        public void HandleFlightAddedEvent_FlightsReceived_ListOfFlightReceived()
        {
            var flightTracks = new List <ITrack>()
            {
                TrackFactory.CreateTestTrack(),
                TrackFactory.CreateTestTrack()
            };

            _airspace.FlightAddedEvent += Raise.EventWith(new FlightAddedEventArg()
            {
                Tracks = flightTracks
            });

            Assert.That(_flightAddedEventArg.Tracks, Is.EqualTo(flightTracks));
        }
コード例 #9
0
        public void HandleFlightAddedEvent_FlightsReceived_EventIsHandled()
        {
            var flightTracks = new List <ITrack>()
            {
                TrackFactory.CreateTestTrack(),
                TrackFactory.CreateTestTrack()
            };

            _airspace.FlightAddedEvent += Raise.EventWith(new FlightAddedEventArg()
            {
                Tracks = flightTracks
            });

            Assert.That(_eventHandled, Is.True);
        }