Esempio n. 1
0
        public void AddClientTests()
        {
            ManagerContextTest mct = new ManagerContextTest(false);
            ServiceManager     sm  = new ServiceManager(new UnitOfWork(mct));

            Client c1 = new Client(ClientType.Vip, Parser.GetDiscounts().Where(s => s.ClientType == ClientType.Vip).ToList(), new Address("Leurshoek", "Beveren", "61"), "Aaron Frans", null, new List <ReservationsPerYear>());

            c1.ClientNumber = 1;

            Action act = () => sm.AddClient(c1);

            act.Should().NotThrow <Exception>();

            Client c2 = new Client(ClientType.ConcertPromotor, Parser.GetDiscounts().Where(s => s.ClientType == ClientType.ConcertPromotor).ToList(), new Address("Leurshoek", "Beveren", "10"), "Jeff Jeff", "BE0823665992", new List <ReservationsPerYear>());

            c2.ClientNumber = 2;
            Client c3 = new Client(ClientType.Particulier, Parser.GetDiscounts().Where(s => s.ClientType == ClientType.Particulier).ToList(), new Address("Kerkstraat", "Gent", "61"), "Jane Doe", null, new List <ReservationsPerYear>());

            c3.ClientNumber = 3;
            Client c4 = new Client(ClientType.Organisatie, Parser.GetDiscounts().Where(s => s.ClientType == ClientType.Organisatie).ToList(), new Address("Kerkstraat", "Antwerpen", "61"), "Jhon Doe", "BE0852665992", new List <ReservationsPerYear>());

            c4.ClientNumber = 4;

            List <Client> cs = new List <Client>()
            {
                c2, c3, c4
            };

            sm.AddClients(cs);
        }
Esempio n. 2
0
 /// <summary>
 /// Add a new client to the database.
 /// </summary>
 /// <param name="toAdd">Client to add to the database.</param>
 public void AddClient(Client toAdd)
 {
     sm.AddClient(toAdd);
     SelectedClient = toAdd;
 }