public void CreateExcursion() { var excursion = DefaultCreator.createExursion(DefaultCreator.createDateTime()); Assert.IsNotNull(excursion); }
public void CheckDate() { var tourOrder = DefaultCreator.createTourOrder( DefaultCreator.createTour() , DefaultCreator.createCustomer()); Assert.AreEqual(tourOrder.Date_Time, DefaultCreator.createDateTime()); }
public void CheckRegistratedTicket() { var airline = DefaultCreator.createAirline(0); var depart = DefaultCreator.createDateTime(2000, 2, 2); var arrive = DefaultCreator.createDateTime(2200, 2, 2); var ticket = DefaultCreator.createTicket(depart, arrive); airline.AddTicket(ticket); Assert.False(airline.CheckTicket(ticket)); }
public void CheckNotRegistratedTicket() { var airline = DefaultCreator.createAirline(0); var depart = DefaultCreator.createDateTime(2000, 2, 2); var arrive = DefaultCreator.createDateTime(2200, 2, 2); var ticket = DefaultCreator.createTicket(depart, arrive); Assert.Throws <Exception>( () => airline.CheckTicket(ticket) ); }
public void ChangeDate() { var tourOrder = DefaultCreator.createTourOrder( DefaultCreator.createTour() , DefaultCreator.createCustomer()); var date = DefaultCreator.createDateTime(2015, 5, 17); tourOrder.Date_Time = date; Assert.AreEqual(tourOrder.Date_Time, date); }
public void AddGuide() { var excursion = DefaultCreator.createExursion(DefaultCreator.createDateTime()); var guide = DefaultCreator.createGuide(); excursion.addGuide(guide); Assert.IsNotEmpty(excursion.getAvailableGuides()); Assert.AreEqual(guide, excursion.getAvailableGuides()[0]); }
public void AddExcursion_DateInTourLessThenDateOfExcursions() { var tourOrder = DefaultCreator.createTourOrder( DefaultCreator.createTour() , DefaultCreator.createCustomer()); var excursion = DefaultCreator.createExursion( DefaultCreator.createDateTime() ); tourOrder.AddExcursion(excursion); }
public void AddExcursion_AddOneExcursion() { var tourOrder = DefaultCreator.createTourOrder( DefaultCreator.createTour() , DefaultCreator.createCustomer()); var excursion = DefaultCreator.createExursion(DefaultCreator.createDateTime()); tourOrder.AddExcursion(excursion); Assert.IsTrue(tourOrder.GetExcursion().Contains(excursion)); }
public void CheckGetAvailableLanguages() { var excursion = DefaultCreator.createExursion(DefaultCreator.createDateTime()); var language = @"Ukranian"; var guide = DefaultCreator.createGuide(language); excursion.addGuide(guide); Assert.IsTrue(excursion.getAvailableLanguages().Contains(language)); }
public void EmptyNameFieldIsForbidden() { Assert.Throws <ArgumentNullException>( () => { new TravelAgencyModel.Excursion( @"" , 322 , DefaultCreator.createDateTime() ); } ); }
public void TwiceAddOneGuide() { var excursion = DefaultCreator.createExursion(DefaultCreator.createDateTime()); var guide = DefaultCreator.createGuide(); excursion.addGuide(guide); Assert.IsNotEmpty(excursion.getAvailableGuides()); Assert.Throws <Exception>( () => excursion.addGuide(guide) ); }
public void AddExcursion_TwiceAddOneExcursion() { var tourOrder = DefaultCreator.createTourOrder( DefaultCreator.createTour() , DefaultCreator.createCustomer()); Excursion excursion = DefaultCreator.createExursion(DefaultCreator.createDateTime()); tourOrder.AddExcursion(excursion); Assert.Throws <ArgumentException>( () => tourOrder.AddExcursion(excursion) ); }
public void GetUnreservedTickets() { var airline = DefaultCreator.createAirline(0); var depart = DefaultCreator.createDateTime(2000, 2, 2); var arrive = DefaultCreator.createDateTime(2200, 2, 2); var ticket = DefaultCreator.createTicket(depart, arrive); var ticket2 = DefaultCreator.createTicket(depart, arrive); ticket2.Reserved = true; airline.AddTicket(ticket); airline.AddTicket(ticket2); var unreservedTicketCollection = airline.GetAvailableTickets(); Assert.True(unreservedTicketCollection.Count == 1); Assert.True(unreservedTicketCollection.Contains(ticket)); }
public void AddExcursion_AddFewExcursion() { var tourOrder = DefaultCreator.createTourOrder( DefaultCreator.createTour() , DefaultCreator.createCustomer()); Excursion excursion1 = DefaultCreator.createExursion(DefaultCreator.createDateTime()); Excursion excursion2 = DefaultCreator.createExursion(DefaultCreator.createDateTime()); tourOrder.AddExcursion(excursion1); tourOrder.AddExcursion(excursion2); Assert.IsTrue(tourOrder.GetExcursion().Contains(excursion1)); Assert.IsTrue(tourOrder.GetExcursion().Contains(excursion2)); }