コード例 #1
0
        public void CheckSortInAirportByMaxLoadCapacity()
        {
            var allPlanes = new MixedAirport {
                Planes = planes
            }.GetSortedPlanesByMaxLoadCapacity();

            Assert.That(allPlanes, Is.Ordered.By(nameof(Plane.MaxLoadCapacity)));
        }
コード例 #2
0
        public void CheckTransportMilitaryPlanesOnly()
        {
            MixedAirport airport = new MixedAirport {
                Planes = planes
            };

            var actualTransportMilitaryPlanes = airport.GetTransportMilitaryPlanes();

            var expectedPlanes = actualTransportMilitaryPlanes.Where(p => p.IsTransport()).ToList();

            CollectionAssert.AreEquivalent(actualTransportMilitaryPlanes, expectedPlanes);
        }
コード例 #3
0
        public void ComparePlanesWithMaxPassengerCapacity()
        {
            MixedAirport airport = new MixedAirport {
                Planes = planes
            };

            PassengerAirport passengerAirport = new PassengerAirport {
                Planes = airport.GetPassengersPlanes()
            };

            PassengerPlane expectedPlaneWithMaxPassengersCapacity = passengerAirport.GetPlaneWithMaxPassengersCapacity();

            Assert.That(planeWithMaxPassengerCapacity, Is.EqualTo(expectedPlaneWithMaxPassengersCapacity));
        }