Пример #1
0
        public void Repository_Repository_IsNotNull()
        {
            IWishListRepository rep = new TestWishListRepository();

            Assert.IsNotNull(rep.GetUsers(), "Users in repository was null");
            Assert.IsNotNull(rep.GetWishes(), "Wishes in repository was null");
        }
Пример #2
0
        public void Repository_WishFilter_Returns_5_Wishes_For_User_1()
        {
            IWishListRepository rep = new TestWishListRepository();

            IList <Wish> wishes = rep.GetWishes().ForUser(1).ToList();

            Assert.AreEqual(5, wishes.Count);
        }
Пример #3
0
        public void Repository_Has_ForUser_Filter_For_Wishes()
        {
            IWishListRepository rep    = new TestWishListRepository();
            IList <Wish>        wishes = rep.GetWishes()
                                         .ForUser(1)
                                         .ToList();

            Assert.IsNotNull(wishes);
        }
Пример #4
0
        public void WishList_Can_Remove_Wish_For_User()
        {
            int ownerId = 1;
            IWishListRepository repository = new TestWishListRepository();

            WishList.Data.WishList list = Service.GetWishList(ownerId);

            int  numberOfWishes  = list.Wishes.Count;
            Wish wishToBeRemoved = list.Wishes[0];

            Service.RemoveWish(wishToBeRemoved);
            list = Service.GetWishList(ownerId);

            Assert.AreEqual <int>(numberOfWishes - 1, list.Wishes.Count, "Number of wishes did not decrease by one when wish list was reloaded");
        }
Пример #5
0
        public void Setup()
        {
            IWishListRepository rep = new TestWishListRepository();

            Service = new WishService(rep, new TestMailService());
        }