Example #1
0
        public void Walker_DeleteWalkerAd()
        {
            Walker   Walker   = (Walker)UserFactory.CreateWalker("WalkerDel", "testnaLozinka", "Ivan", "Horvat", "123456789", "Unska 3", "Zagreb", 40, UserType.WALKER, true, false);
            WalkerAd WalkerAd = (WalkerAd)AdFactory.CreateWalkerAd(40.0, "Setam pse POVOLJNO", AdStatus.ACTIVE,
                                                                   "Obozavam pse", new DateTime(2019, 8, 28, 12, 5, 0), 3, 4, Walker);

            Walker.AddAd((WalkerAd)WalkerAd);

            UserRepository repository = new UserRepository();

            repository.AddUser(Walker);

            Walker.DeleteAd((WalkerAd)WalkerAd);

            Debug.Assert(Walker.Ads.Count == 0);

            repository.DeleteUser(Walker);
        }