Exemplo n.º 1
0
        public void WishService_Can_Get_Wish_1()
        {
            int wishId = 1;

            WishList.Data.Wish wish = Service.GetWish(wishId);

            Assert.IsNotNull(wish, "Wish was null");
            Assert.AreEqual <int>(wishId, wish.Id, "Wish id did not match");
            Assert.AreEqual <int>(1, wish.Owner.Id, "Owner.Id was not 1");
        }
Exemplo n.º 2
0
        public void WishService_Can_Update_Wish()
        {
            int wishId = 1;

            WishList.Data.Wish wish = Service.GetWish(wishId);

            Assert.AreEqual <int>(wishId, wish.Id, "Wish id did not match");

            wish.Name        = "Wish1 - Updated";
            wish.Description = "Updated description";
            wish.LinkUrl     = "http://updatedlink.com";

            Service.SaveWish(wish, false);

            WishList.Data.Wish updatedWish = Service.GetWish(wishId);

            Assert.IsNotNull(updatedWish, "Updated wish was null");
            Assert.AreEqual <string>(wish.Name, updatedWish.Name, "Name did not match");
            Assert.AreEqual <string>(wish.Description, updatedWish.Description, "Description did not match");
            Assert.AreEqual <string>(wish.LinkUrl, updatedWish.LinkUrl, "LinkUrl did not match");
        }