public void The_DessertService_can_like_the_dessert()
        {
            //Arrange
            var dessertRepo = new DessertRepository(_unitOfWorkMock.Object);
            var dessertSvc = new DessertService(dessertRepo);
            var oldLikes = _testDessert.Likes;

            //Actions
            var newDessert = dessertSvc.LikeDessert(_testDessert.ID);

            //Assertions
            _unitOfWorkMock.Verify(uow => uow.Get<Dessert>(_dessertGuid));
            _unitOfWorkMock.Verify(uow => uow.Update(_testDessert));
            Assert.That(newDessert.Likes == oldLikes + 1);
        }
        public void The_dessert_repository_can_persist_the_dessert()
        {
            //Arrange
            var repo = new DessertRepository(_unitOfWorkMock.Object);

            //Action
            repo.Save(_testDessert);

            //Assertions
            _unitOfWorkMock.Verify(uow => uow.AddToSession(_testDessert));
        }
        public void The_DessertRepository_can_query_in_order_of_rating_List_from_datasource()
        {
            //Arrange
            IDessertRepository dessertRepo = new DessertRepository(_unitOfWorkMock.Object);

            //Action
            IList<Dessert> dessertList = dessertRepo.GetInOrder(dessert => dessert.Likes >= 0
                , dessert => dessert.Likes
                , false);

            //Assertions
            _unitOfWorkMock.Verify(uow => uow.GetAll<Dessert, int>(dessert => dessert.Likes >= 0
                , dessert => dessert.Likes
                , false));
            Assert.That(dessertList.Count == 2);
            Assert.AreEqual(dessertList[0], _testDessert2);
            Assert.AreEqual(dessertList[1], _testDessert1);
        }