public void GetFavoriteShouldReturnAList() { string userId = "cyk"; var actual = repository.GetFavouriteById(userId); Assert.IsAssignableFrom <List <Favourite> >(actual); Assert.NotEmpty(actual); }
public List<Favourite> GetFavouriteById(string userName) { var favouriteAvailibilityStatus = favouriteRepository.IsFavouriteExistWithId(userName); if (favouriteAvailibilityStatus) { return favouriteRepository.GetFavouriteById(userName); } else { throw new FavouriteNotFoundException("Favourite not found"); } }