Ejemplo n.º 1
0
 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));
 }
Ejemplo n.º 2
0
 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));
 }
Ejemplo n.º 3
0
        public void TestEqualsMethodWithTwoEquivalentFlights()
        {
            Flight flight1 = new Flight(startDate, endDate, someMiles);
            Flight flight2 = new Flight(startDate, endDate, someMiles);

            Assert.True(flight1.Equals(flight2));
        }
Ejemplo n.º 4
0
        public void TestThatAFlightDoesNotEqualAnotherObject()
        {
            var flight = new Flight(StartTime, EndTime, miles);
            var hotel = new Hotel(5);

            Assert.False(flight.Equals(hotel));
        }
Ejemplo n.º 5
0
 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));
 }
Ejemplo n.º 6
0
        public void TestThatTwoFlightsAreEqual()
        {
            var flightOne = new Flight(StartTime, EndTime, miles);
            var flightTwo = new Flight(StartTime, EndTime, miles);

            Assert.True(flightOne.Equals(flightTwo));
        }
Ejemplo n.º 7
0
        public void TestEqualsMethodWithTwoDifferentFlights()
        {
            Flight flight1 = new Flight(startDate, endDate, 500);
            Flight flight2 = new Flight(startDate, endDate, 100);

            Assert.False(flight1.Equals(flight2));
        }
Ejemplo n.º 8
0
 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));
 }
Ejemplo n.º 9
0
 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));
 }
Ejemplo n.º 10
0
 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));
 }
Ejemplo n.º 11
0
        public void TestThatTwoFlightsAreNotEqualWithDifferentMiles()
        {
            var flightOne = new Flight(StartTime, EndTime, miles);
            var flightTwo = new Flight(StartTime, EndTime, 432);

            Assert.False(flightOne.Equals(flightTwo));
        }
Ejemplo n.º 12
0
 public void TestThatFlightEqualsReturnsTrueOnSameFlight()
 {
     var target = new Flight(startDate, endDate, 1000);
     Assert.True(target.Equals(target));
 }
Ejemplo n.º 13
0
 public void TestThatFlightEqualsReturnsTrueOnSameFlightInfoReverse()
 {
     var target1 = new Flight(startDate, endDate, 1000);
     var target2 = new Flight(startDate, endDate, 1000);
     Assert.True(target2.Equals(target1));
 }
Ejemplo n.º 14
0
 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));
 }
Ejemplo n.º 15
0
 public void TestThatFlightEqualsReturnsFalseOnObjectOtherThanFlight()
 {
     var target = new Flight(startDate, endDate, 1001);
     var hotel = new Hotel(10);
     Assert.False(target.Equals(hotel));
 }
Ejemplo n.º 16
0
 public void TestFlightEquals()
 {
     var target1 = new Flight(new DateTime(1990, 2, 3), new DateTime(1991, 2, 3), 100);
     var target2 = new Flight(new DateTime(1990, 2, 3), new DateTime(1991, 2, 3), 100);
     Assert.AreEqual(true, target1.Equals(target2));
 }
Ejemplo n.º 17
0
 public void TestTathFlightsAreEqual()
 {
     var target = new Flight(new DateTime(2011, 3, 17), new DateTime(2011, 3, 18), 5000);
     var target2 = new Flight(new DateTime(2011, 3, 17), new DateTime(2011, 3, 18), 5000);
     Assert.True(target.Equals( target2));
 }
Ejemplo n.º 18
0
 public void TestThatFlightsAreNotEqual()
 {
     var target = new Flight(DateThatFlightLeaves, DateThatFlightReturns, someMiles);
     var target2 = new Flight(DateThatFlightLeaves, DateThatFlightReturnsNextMonth, someMiles);
     Assert.IsFalse(target.Equals(target2));
 }
Ejemplo n.º 19
0
 public void TestFlightEqualOnTrue()
 {
     var target = new Flight(startDate, new DateTime(2011, 3, 11), 100);
     Assert.True(target.Equals(new Flight(startDate, new DateTime(2011, 3, 11), 100)));
 }
Ejemplo n.º 20
0
        public void TestThatTwoFlightsNotEqual()
        {
            var start = new DateTime(1999, 1, 1);
            var end = new DateTime(1999, 1, 2);
            int miles = 100;
            var flight = new Flight(start, end, miles);

            //var start1 = new DateTime(1999, 1, 1);
            //var end1 = new DateTime(1999, 1, 4);
            //int miles1 = 200;
            var notFlight = new User("NotAFlight");

            Assert.False(flight.Equals(notFlight));
        }
Ejemplo n.º 21
0
        public void TestThatTwoFlightsAreEqual()
        {
            var start = new DateTime(1999, 1, 1);
            var end = new DateTime(1999, 1, 2);
            int miles = 100;
            var flight = new Flight(start, end, miles);

            var start1 = new DateTime(1999, 1, 1);
            var end1 = new DateTime(1999, 1, 2);
            int miles1 = 100;
            var flight1 = new Flight(start1, end1, miles1);

            Assert.True(flight.Equals(flight1));
        }
Ejemplo n.º 22
0
 public void TestThatOverrideBoolEqualsReturnsFlightObject()
 {
     var target = new Flight(dateFlightLeaves, dateFlightReturns, mileage);
     Assert.True(target.Equals(target));
 }
Ejemplo n.º 23
0
 public void TestThatFlightsAreEqual()
 {
     var target = new Flight(DateThatFlightLeaves, DateThatFlightReturns, someMiles);
     var target2 = new Flight(DateThatFlightLeaves, DateThatFlightReturns, someMiles);
     Assert.IsTrue(target.Equals(target2));
 }
Ejemplo n.º 24
0
 public void TestIfTwoFlightsAreNotEqual()
 {
     var target = new Flight(startDate, endDate, 20);
     var target1 = new Flight(startDate, endDate, 19);
     Assert.AreEqual(false, target.Equals(target1));
 }
Ejemplo n.º 25
0
 public void TestThatFlightEqualsReturnsFalseOnDifferentEndDate()
 {
     var target1 = new Flight(startDate, new DateTime(2010, 11, 20), 1000);
     var target2 = new Flight(startDate, endDate, 1000);
     Assert.False(target1.Equals(target2));
 }
Ejemplo n.º 26
0
 public void TestThatFlightEqualsReturnsFalseOnDifferentMilesReverse()
 {
     var target1 = new Flight(startDate, endDate, 1001);
     var target2 = new Flight(startDate, endDate, 1000);
     Assert.False(target2.Equals(target1));
 }
Ejemplo n.º 27
0
 public void TestFlightsEqual()
 {
     var FlightA = new Flight(DateTime.Now, DateTime.MaxValue, milesForFlight);
     var FlightB = new Flight(DateTime.Now, DateTime.MaxValue, milesForFlight);
     Assert.True(FlightA.Equals(FlightB));
 }
Ejemplo n.º 28
0
 public void TestFlightEqualsMethod()
 {
     var target = new Flight(DateTime.Today, DateTime.Today.AddDays(10), 500);
     var target2 = new Flight(DateTime.Today, DateTime.Today.AddDays(10), 500);
     Assert.IsTrue(target.Equals(target2));
 }