Esempio n. 1
0
        public void ChangeOrgAccount_InvalidTest()
        {
            IClientManager clientManager = new ClientManager();

            ShoppingClient.Clients.Clear();
            clientManager.RegisterOrg("Prodavnica", "q234ffsad", "Novi Sad", "*****@*****.**", new DateTime(2010, 1, 1), new List <IAccount>());

            List <IAccount> newList = new List <IAccount>();
            IOrganization   org     = ShoppingClient.Clients[0] as IOrganization;
            IOrganization   org2    = new PravnoLice("fasdfasd", "frfewrf", "ASDFASDF", "*****@*****.**", DateTime.Now, null);


            Assert.Throws <KeyNotFoundException>(() => clientManager.ChangeOrgAccount(org2, newList));
        }
Esempio n. 2
0
        public void ChangeOrgAccount_ValidTest()
        {
            IClientManager clientManager = new ClientManager();

            ShoppingClient.Clients.Clear();
            clientManager.RegisterOrg("Prodavnica", "q234ffsad", "Novi Sad", "*****@*****.**", new DateTime(2010, 1, 1), new List <IAccount>());

            List <IAccount> newList = new List <IAccount>();
            IOrganization   org     = ShoppingClient.Clients[0] as IOrganization;

            clientManager.ChangeOrgAccount(org, newList);

            Assert.AreEqual(newList, org.ListOfAccounts);
        }