public void CreateRecommendShouldReturnRecommend() { Recommend recommends = new Recommend { UserName = "******", title = "News" }; var actual = repository.AddRecommendations(recommends); Assert.IsAssignableFrom <Recommend>(actual); Assert.Equal(3, actual.RecommendId); }
public Recommend AddRecommends(Recommend recommend) { var availability = _repository.GetRecommendsByTitle(recommend); if (availability.Count == 0) { return(_repository.AddRecommendations(recommend)); } else { throw new RecommendAlreadyExist("Recommend already Exist"); } }