本文整理汇总了C#中Expedia.Flight.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# Flight.Equals方法的具体用法?C# Flight.Equals怎么用?C# Flight.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Expedia.Flight
的用法示例。
在下文中一共展示了Flight.Equals方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestThatFlightEqualsWorks
public void TestThatFlightEqualsWorks()
{
var target = new Flight(System.DateTime.Today, System.DateTime.Parse("10/5/2012"), 100);
var target2 = new Flight(System.DateTime.Today, System.DateTime.Parse("10/5/2012"), 100);
var target3 = new Flight(System.DateTime.Today, System.DateTime.Parse("10/6/2012"), 100);
Assert.True(target.Equals(target2));
Assert.False(target.Equals(target3));
}
示例2: TestFlightsInequalityDueToStartDate
public void TestFlightsInequalityDueToStartDate()
{
DateTime rDate = DateTime.Now.AddDays(10);
var target1 = new Flight(DateTime.Now, rDate, 10);
var target2 = new Flight(DateTime.Now, rDate, 10);
Assert.IsFalse(target1.Equals(target2));
}
示例3: TestEqualsMethodWithTwoEquivalentFlights
public void TestEqualsMethodWithTwoEquivalentFlights()
{
Flight flight1 = new Flight(startDate, endDate, someMiles);
Flight flight2 = new Flight(startDate, endDate, someMiles);
Assert.True(flight1.Equals(flight2));
}
示例4: TestThatAFlightDoesNotEqualAnotherObject
public void TestThatAFlightDoesNotEqualAnotherObject()
{
var flight = new Flight(StartTime, EndTime, miles);
var hotel = new Hotel(5);
Assert.False(flight.Equals(hotel));
}
示例5: TestFlightsInequalityDueToEndDate
public void TestFlightsInequalityDueToEndDate()
{
DateTime sDate = DateTime.Now;
var target1 = new Flight(sDate, DateTime.Now.AddDays(10), 10);
var target2 = new Flight(sDate, DateTime.Now.AddDays(10), 10);
Assert.IsFalse(target1.Equals(target2));
}
示例6: TestThatTwoFlightsAreEqual
public void TestThatTwoFlightsAreEqual()
{
var flightOne = new Flight(StartTime, EndTime, miles);
var flightTwo = new Flight(StartTime, EndTime, miles);
Assert.True(flightOne.Equals(flightTwo));
}
示例7: TestEqualsMethodWithTwoDifferentFlights
public void TestEqualsMethodWithTwoDifferentFlights()
{
Flight flight1 = new Flight(startDate, endDate, 500);
Flight flight2 = new Flight(startDate, endDate, 100);
Assert.False(flight1.Equals(flight2));
}
示例8: TestFlightsInequalityDueToMiles
public void TestFlightsInequalityDueToMiles()
{
DateTime sDate = DateTime.Now;
DateTime rDate = DateTime.Now.AddDays(10);
Flight target1 = new Flight(sDate, rDate, 10);
Flight target2 = new Flight(sDate, rDate, 20);
Assert.IsFalse(target1.Equals(target2));
}
示例9: TestFlightEqualsTrue
public void TestFlightEqualsTrue()
{
DateTime StartDate = new DateTime(2009, 11, 1);
DateTime EndDate = new DateTime(2009, 11, 1);
var target = new Flight(StartDate, EndDate, 700);
var target2 = new Flight(StartDate, EndDate, 700);
Assert.True(target.Equals(target2));
}
示例10: TestFlightsEquality
public void TestFlightsEquality()
{
DateTime sDate = DateTime.Now;
DateTime rDate = DateTime.Now.AddDays(10);
Flight target1 = new Flight(sDate, rDate, 10);
Flight target2 = new Flight(sDate, rDate, 10);
Assert.IsTrue(target1.Equals(target2));
}
示例11: TestThatTwoFlightsAreNotEqualWithDifferentMiles
public void TestThatTwoFlightsAreNotEqualWithDifferentMiles()
{
var flightOne = new Flight(StartTime, EndTime, miles);
var flightTwo = new Flight(StartTime, EndTime, 432);
Assert.False(flightOne.Equals(flightTwo));
}
示例12: TestThatFlightEqualsReturnsTrueOnSameFlight
public void TestThatFlightEqualsReturnsTrueOnSameFlight()
{
var target = new Flight(startDate, endDate, 1000);
Assert.True(target.Equals(target));
}
示例13: TestThatFlightEqualsReturnsTrueOnSameFlightInfoReverse
public void TestThatFlightEqualsReturnsTrueOnSameFlightInfoReverse()
{
var target1 = new Flight(startDate, endDate, 1000);
var target2 = new Flight(startDate, endDate, 1000);
Assert.True(target2.Equals(target1));
}
示例14: TestThatFlightEqualsReturnsFalseOnDifferentStartDateReverse
public void TestThatFlightEqualsReturnsFalseOnDifferentStartDateReverse()
{
var target1 = new Flight(new DateTime(2010, 9, 20), endDate, 1000);
var target2 = new Flight(startDate, endDate, 1000);
Assert.False(target2.Equals(target1));
}
示例15: TestThatFlightEqualsReturnsFalseOnObjectOtherThanFlight
public void TestThatFlightEqualsReturnsFalseOnObjectOtherThanFlight()
{
var target = new Flight(startDate, endDate, 1001);
var hotel = new Hotel(10);
Assert.False(target.Equals(hotel));
}