public void CreateCustomer() { var customer = DefaultCreator.createCustomer(); Assert.AreEqual(customer.Name, @"Test_John"); Assert.AreEqual(customer.Surname, @"Test_Doe"); }
public void InitiallyDefaultValueAmountOfPeople() { var tourOrder = DefaultCreator.createTourOrder( DefaultCreator.createTour() , DefaultCreator.createCustomer()); Assert.AreEqual(tourOrder.AmountPeople, 1); }
public void CheckDate() { var tourOrder = DefaultCreator.createTourOrder( DefaultCreator.createTour() , DefaultCreator.createCustomer()); Assert.AreEqual(tourOrder.Date_Time, DefaultCreator.createDateTime()); }
public void ChangeAmountPeople() { var tourOrder = DefaultCreator.createTourOrder( DefaultCreator.createTour() , DefaultCreator.createCustomer()); tourOrder.AmountPeople = 2; Assert.AreEqual(tourOrder.AmountPeople, 2); }
public void ChangeAmmounOfPeopleToNonPositive() { var tourOrder = DefaultCreator.createTourOrder( DefaultCreator.createTour() , DefaultCreator.createCustomer()); Assert.Throws <ArgumentException>( () => tourOrder.AmountPeople = -1 ); }
public void CheckAddHistory() { var account = DefaultCreator.createAccount(); var tourOrder = DefaultCreator.createTourOrder( DefaultCreator.createTour() , DefaultCreator.createCustomer()); account.AddTourOrder(tourOrder); Assert.True(account.History.Contains(tourOrder)); }
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 AddingTourForRegistratedCustomer() { var customer = DefaultCreator.createRegistrateCustomer(); var tourOrder = DefaultCreator.createTourOrder( DefaultCreator.createTour() , DefaultCreator.createCustomer()); customer.addTour(tourOrder); Assert.NotNull(customer.Account); Assert.IsTrue(customer.Account.History.Contains(tourOrder)); }
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 SendingTour() { var tourOrder = DefaultCreator.createTourOrder( DefaultCreator.createTour() , DefaultCreator.createCustomer()); var mockHandler = Substitute.For <EventHandler>(); tourOrder.SendingTour += mockHandler; tourOrder.SendTourForOperator(); mockHandler.Received(1).Invoke(tourOrder, EventArgs.Empty); }
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 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)); }
public void EmptySurnameFieldIsForbidden() { Assert.Throws <ArgumentException>( () => DefaultCreator.createCustomer(@"Test_John", @"") ); }
public void InitiallyAccountIsNotSet() { var customer = DefaultCreator.createCustomer(); Assert.Null(customer.Account); }