public void Find_WhenFindUnknownWish_ThenReturnEmpty() { // Arrange var wish = new WishDto(); var service = new WishListService(_unitOfWorkFake, _mapper, _validator); // Act var result = service.Find(string.Empty); // Assert Assert.IsEmpty(result); }
public void Find_WhenFindWish_ThenReturnNeeded() { // Arrange var wishDto = new WishDto(); var wish = new Wish(); var service = new WishListService(_unitOfWorkFake, _mapper, _validator); A.CallTo(() => _unitOfWorkFake.WishListRepository.Find(A <Func <Wish, bool> > ._)) .Returns(new List <Wish> { wish }); // Act var returnedWish = service.Find(wish.Id.ToString()); // Assert Assert.AreEqual(wishDto.Id, returnedWish[0].Id); }