コード例 #1
0
        public void GetFavoriteShouldReturnAList()
        {
            string userId = "cyk";
            var    actual = repository.GetFavouriteById(userId);

            Assert.IsAssignableFrom <List <Favourite> >(actual);
            Assert.NotEmpty(actual);
        }
コード例 #2
0
 public List<Favourite> GetFavouriteById(string userName)
 {
     var favouriteAvailibilityStatus = favouriteRepository.IsFavouriteExistWithId(userName);
     if (favouriteAvailibilityStatus)
     {
         return favouriteRepository.GetFavouriteById(userName);
     }
     else
     {
         throw new FavouriteNotFoundException("Favourite not found");
     }
 }