예제 #1
0
 public void TestThatFlightHasCorrectBasePriceFor20DayFlight()
 {
     DateTime dateTestFlightLeaves = new DateTime(2011, 3, 18);
     DateTime dateTestFlightReturns = new DateTime(2011, 4, 7);
     var target = new Flight(dateTestFlightLeaves, dateTestFlightReturns, someMiles);
     Assert.AreEqual(600, target.getBasePrice());
 }
예제 #2
0
 public void TestThatFlightHasCorrectBasePriceForTwoDays()
 {
     DateTime start = new DateTime(2005, 9, 17);
     DateTime end = new DateTime(2005, 9, 19);
     var target = new Flight(start, end, 500);
     Assert.AreEqual(240, target.getBasePrice());
 }
예제 #3
0
 public void TestThatFlightHasCorrectBasePriceForTravelOnSameDay()
 {
     DateTime dateFlightLeaves = new DateTime(2012, 1, 1);
     DateTime dateFlightReturns = new DateTime(2012, 1, 1);
     var target = new Flight(dateFlightLeaves, dateFlightReturns, mileage);
     Assert.AreEqual(200, target.getBasePrice());
 }
예제 #4
0
 public void TesThatFlightHasCorrectBasePriceForOneDayFlight()
 {
     DateTime dateTestFlightLeaves = new DateTime(2010, 1, 18);
     DateTime dateTestFlightReturns = new DateTime(2010, 1, 19);
     var target = new Flight(dateTestFlightLeaves, dateTestFlightReturns, someMiles);
     Assert.AreEqual(220, target.getBasePrice());
 }
예제 #5
0
 public void TestThatFlightBookingPriceCorrectZeroDayDifference()
 {
     DateTime startDate = new DateTime(2012, 3, 4);
     DateTime endDate = new DateTime(2012, 3, 4);
     var target = new Flight(startDate, endDate, 5);
     Assert.AreEqual(200, target.getBasePrice());
 }
예제 #6
0
 public void TestThatFlightHasIncorrectBasePriceFor1DayFlight()
 {
     DateTime dateTestFlightLeaves = new DateTime(2011, 3, 18);
     DateTime dateTestFlightReturns = new DateTime(2011, 3, 19);
     var target = new Flight(dateTestFlightLeaves, dateTestFlightReturns, someMiles);
     Assert.AreNotEqual(230, target.getBasePrice());
 }
예제 #7
0
 public void TestThatFlightHasCorrectBasePriceForTwoDayTrip()
 {
     var start = new DateTime(1999, 1, 1);
     var end = new DateTime(1999, 1, 3);
     int miles = 100;
     var target = new Flight(start, end, miles);
     Assert.AreEqual(240, target.getBasePrice());
 }
예제 #8
0
 public void TestTwoDaySpan()
 {
     var target = new Flight(new DateTime(2010, 1, 18), new DateTime(2010, 1, 20), 67);
     Assert.AreEqual(240, target.getBasePrice());
 }
예제 #9
0
 public void TestFlightPrice()
 {
     var target = new Flight(System.DateTime.Now, System.DateTime.Now, 100);
     Assert.AreEqual(200, target.getBasePrice());
 }
예제 #10
0
 public void TestThatFlightHasCorrectBasePriceForOneDayFlight()
 {
     var target = new Flight(startDate, endDate, miles);
     Assert.AreEqual(220, target.getBasePrice());
 }
예제 #11
0
 public void TestThatFlightHasCorrectBasePriceForTwoDayFlight()
 {
     var target = new Flight(new DateTime(2011, 2, 5), new DateTime(2011, 2, 7), 50);
     Assert.AreEqual(240, target.getBasePrice());
 }
예제 #12
0
 public void TestThatFlightHasCorrectBasePriceForTenDaysApart()
 {
     var target = new Flight((new DateTime(2012, 1, 1, 7, 0, 0)), (new DateTime(2012, 1, 11, 7, 0, 0)), 500);
     Assert.AreEqual(400, target.getBasePrice());
 }
예제 #13
0
 public void TestThatFlightHasCorrectBasePriceForTwoDayFlight()
 {
     var target = new Flight(startDate, endDate+TimeSpan.FromDays(1), miles);
     Assert.AreEqual(240, target.getBasePrice());
 }
예제 #14
0
 public void TestThatHasCorrectBasePriceTwoDay()
 {
     var target = new Flight(startDate, new DateTime(2010, 10,20), miles);
     Assert.AreEqual(240, target.getBasePrice());
 }
예제 #15
0
 public void TestThatUserTotalCostIsCorrect()
 {
     var flight = new Flight(StartDate, EndDate, 500);
     target.book(flight);
     Assert.AreEqual(flight.getBasePrice(), target.Price);
 }
예제 #16
0
 public void TestThatFlightHasCorrectBasePriceForTwoDayFlight()
 {
     var target = new Flight(startDate, new DateTime(2011,1,3), flightMiles);
     Assert.AreEqual(240, target.getBasePrice());
 }
예제 #17
0
 public void TestThatFlightHasCorrectBasePriceForThreeDayFlight()
 {
     var target = new Flight(new DateTime(2011, 1, 1), new DateTime(2011, 1, 4), miles);
     Assert.AreEqual(260, target.getBasePrice());
 }
예제 #18
0
 public void TestThatFlightHasCorrectBasePriceForTwoDays()
 {
     var target = new Flight(DateTime.Now, DateTime.Now.AddDays(2), 5);
     Assert.AreEqual(240, target.getBasePrice());
 }
예제 #19
0
 public void TestThatFlightHasCorrectBasePriceForTenDays()
 {
     var target = new Flight(DateTime.Now, DateTime.Now.AddDays(10), 10);
     Assert.AreEqual((200+10*20), target.getBasePrice());
 }
예제 #20
0
 public void TestThatFlightHasCorrectBasePriceForOneDay()
 {
     var target = new Flight(DateTime.Now, DateTime.Now.AddDays(1), 1);
     Assert.AreEqual(220, target.getBasePrice());
 }
예제 #21
0
 public void TestThatFlightHasCorrectBasePriceForFourDaysBridgingLeapYearFebruaryMonth()
 {
     var target = new Flight(DateThatFlightReturnsInLeapYearFebruary, DateThatFlightReturnsAfterLeapYearFebruary, someMiles);
     Assert.AreEqual(280, target.getBasePrice());
 }
예제 #22
0
 public void TestFlightPriceTenDaySpread()
 {
     var flight = new Flight(new DateTime(2012, 3, 14), new DateTime(2012, 3, 24), 333);
     Assert.AreEqual(flight.getBasePrice(), 400);
 }
예제 #23
0
 public void TestThatPriceIsCorrect()
 {
     var target = new Flight(startDate, endDate, miles);
     Assert.AreEqual(target.getBasePrice(), 200+20*9);
 }
예제 #24
0
 public void TestThatFlightHasCorrectBasePriceForThreeDaysBridgingMonths()
 {
     var target = new Flight(DateThatFlightLeaves, DateThatFlightReturnsNextMonth, someMiles);
     Assert.AreEqual(260, target.getBasePrice());
 }
예제 #25
0
 public void TestThatFlightHasCorrectBasePriceForTwoDayFlight()
 {
     var target = new Flight(date1, dateTwo, 300);
     Assert.AreEqual(200 + ((2) * 20), target.getBasePrice());
 }
예제 #26
0
 public void TestThatFlightHasCorrectBasePriceForTwoDays()
 {
     var target = new Flight(DateThatFlightLeaves, DateThatFlightReturns, someMiles);
     Assert.AreEqual(240, target.getBasePrice());
 }
예제 #27
0
 public void TestThatUserTotalCostIsCorrectWhenMoreThanFlights()
 {
     var car = new Car(5);
     var flight = new Flight(StartDate, EndDate, 500);
     target.book(flight);
     target.book(car);
     Assert.AreEqual(flight.getBasePrice() + car.getBasePrice(), target.Price);
 }
예제 #28
0
        public void TestGetBasePriceWithFiveDays()
        {
            Flight flight1 = new Flight(startDate, new DateTime(2012, 3, 18), someMiles);

            Assert.AreEqual(300, flight1.getBasePrice());
        }
예제 #29
0
 public void TestThatFlightHasCorrectBasePriceForTwoDayApart()
 {
     var target = new Flight((new DateTime(2012, 1, 1, 7, 0, 0)), (new DateTime(2012, 1, 3, 7, 0, 0)), 200);
     Assert.AreEqual(240, target.getBasePrice());
 }
예제 #30
0
        public void TestGetBasePriceWithOneDay()
        {
            Flight flight1 = new Flight(startDate, endDate, someMiles);

            Assert.AreEqual(220, flight1.getBasePrice());
        }