Esempio n. 1
0
        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));
        }
Esempio n. 2
0
        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)
                );
        }
Esempio n. 3
0
        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));
        }
Esempio n. 4
0
 public void EmptyNameFieldIsForbidden()
 {
     Assert.Throws <ArgumentException>(
         () => DefaultCreator.createAirline(1, @"")
         );
 }
Esempio n. 5
0
        public void CreateAirline()
        {
            var airline = DefaultCreator.createAirline();

            Assert.AreEqual(airline.Name, @"test_airline");
        }