本文整理汇总了C#中Expedia.Flight类的典型用法代码示例。如果您正苦于以下问题:C# Flight类的具体用法?C# Flight怎么用?C# Flight使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Flight类属于Expedia命名空间,在下文中一共展示了Flight类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestThatFlightHasCorrectBasePriceFor20DayFlight
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: TestThatFlightHasCorrectBasePriceForTwoDays
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: TestThatTwoFlightsAreEqual
public void TestThatTwoFlightsAreEqual()
{
var flightOne = new Flight(StartTime, EndTime, miles);
var flightTwo = new Flight(StartTime, EndTime, miles);
Assert.True(flightOne.Equals(flightTwo));
}
示例4: TestThatFlightHasIncorrectBasePriceFor1DayFlight
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());
}
示例5: TestThatAFlightDoesNotEqualAnotherObject
public void TestThatAFlightDoesNotEqualAnotherObject()
{
var flight = new Flight(StartTime, EndTime, miles);
var hotel = new Hotel(5);
Assert.False(flight.Equals(hotel));
}
示例6: TestThatFlightsWithDifferentStartDatesAreNotEqual
public void TestThatFlightsWithDifferentStartDatesAreNotEqual()
{
var f1 = new Flight(new DateTime(2014, 1, 1), ValidEndDate, ValidMiles);
var f2 = new Flight(new DateTime(2014, 1, 2), ValidEndDate, ValidMiles);
Assert.AreNotEqual(f1, f2);
}
示例7: TestThatFlightsWithDifferentMilesAreNotEqual
public void TestThatFlightsWithDifferentMilesAreNotEqual()
{
var f1 = new Flight(ValidStartDate, ValidEndDate, 1);
var f2 = new Flight(ValidStartDate, ValidEndDate, 2);
Assert.AreNotEqual(f1, f2);
}
示例8: TestThatFlightHasCorrectBasePriceForTravelOnSameDay
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());
}
示例9: TesThatFlightHasCorrectBasePriceForOneDayFlight
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());
}
示例10: TestThatFlightInitializes
public void TestThatFlightInitializes()
{
DateTime startDate = new DateTime(2012, 3, 4);
DateTime endDate = new DateTime(2012, 3, 7);
var target = new Flight(startDate, endDate, 5);
Assert.IsNotNull(target);
}
示例11: TestThatFlightBookingPriceCorrectZeroDayDifference
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());
}
示例12: TestFlightNotEqualToOtherObject
public void TestFlightNotEqualToOtherObject()
{
var f1 = new Flight(ValidStartDate, ValidEndDate, ValidMiles);
var o2 = new Object();
Assert.AreNotEqual(f1, o2);
}
示例13: TestEqualsMethodWithTwoDifferentFlights
public void TestEqualsMethodWithTwoDifferentFlights()
{
Flight flight1 = new Flight(startDate, endDate, 500);
Flight flight2 = new Flight(startDate, endDate, 100);
Assert.False(flight1.Equals(flight2));
}
示例14: TestEqualsMethodWithTwoEquivalentFlights
public void TestEqualsMethodWithTwoEquivalentFlights()
{
Flight flight1 = new Flight(startDate, endDate, someMiles);
Flight flight2 = new Flight(startDate, endDate, someMiles);
Assert.True(flight1.Equals(flight2));
}
示例15: TestSameFlightsAreEqual
public void TestSameFlightsAreEqual()
{
var f1 = new Flight(ValidStartDate, ValidEndDate, ValidMiles);
var f2 = new Flight(ValidStartDate, ValidEndDate, ValidMiles);
Assert.AreEqual(f1, f2);
}