示例#1
0
        public void ShouldCalculateFuelBetwenTwoAirportsWhenCreateFlight()
        {
            var expectedQuantityOfFuel      = 46808.6;
            var dummyFlightBetweenCasaParis = FakeData.GetFlightBetweenCasaParis();

            _flightRepoMoq.Setup(s => s.CreateFlight(dummyFlightBetweenCasaParis)).Returns(() => It.IsAny <int>());
            var module = new FlightModule(_flightRepoMoq.Object);
            var result = module.CreateFlight(dummyFlightBetweenCasaParis);

            Assert.AreEqual(expectedQuantityOfFuel, result.AmountOfFuel);
        }
示例#2
0
        public void ShouldCalculateDistanceBetwenTwoAirportsWhenCreateFlight()
        {
            var expectedDistanceInKm        = 1933;
            var dummyFlightBetweenCasaParis = FakeData.GetFlightBetweenCasaParis();

            _flightRepoMoq.Setup(s => s.CreateFlight(dummyFlightBetweenCasaParis)).Returns(() => It.IsAny <int>());
            var module = new FlightModule(_flightRepoMoq.Object);
            var result = module.CreateFlight(dummyFlightBetweenCasaParis);

            Assert.AreEqual(expectedDistanceInKm, result.DistanceInKM);
        }