public void CanSearchAuthors() { // Arrange var author = A<string>(); var mock = Mock<IGalleryFeedContext>(); mock .Setup(x => x.AllPackages) .Returns(new[] { new V1FeedPackage { Authors = author }, // Author equals new V1FeedPackage { Authors = A<string>() + "," + author + "," + A<string>() }, // Author contained new V1FeedPackage { Authors = author + "," + A<string>() }, // Author first new V1FeedPackage { Authors = A<string>() + "," + author }, // Author last new V1FeedPackage { Authors = A<string>() }, // Author not contained }.AsQueryable()); var nuGetOrgFeed = new NuGetOrgFeed(mock.Object); // Act var result = nuGetOrgFeed.SearchAuthors(author); // Assert Assert.That(result != null); Assert.That(result.Count(), Is.EqualTo(1)); Assert.That(result.First(), Is.EqualTo(author)); }
public FeedController(UserRepository userRepository, FeedRepository feedRepository, ListController listController, UploadPackagesRequestRepository uploadPackagesRequestRepository, NuGetOrgFeed nuGetOrgFeed, SyndicationHelper syndicationHelper) { _userRepository = userRepository; _feedRepository = feedRepository; _listController = listController; _uploadPackagesRequestRepository = uploadPackagesRequestRepository; _nuGetOrgFeed = nuGetOrgFeed; _syndicationHelper = syndicationHelper; }
public PackagesController(NuGetOrgFeed nuGetOrgFeed) { _nuGetOrgFeed = nuGetOrgFeed; }
public ListController(NuGetOrgFeed nuGetOrgFeed) { _nuGetOrgFeed = nuGetOrgFeed; }
public HomeController(FeedRepository feedRepository, NuGetOrgFeed nuGetOrgFeed) { _feedRepository = feedRepository; _nuGetOrgFeed = nuGetOrgFeed; }
public CategoryController(CategoryRepository categoryRepository, NuGetOrgFeed nuGetOrgFeed) { _categoryRepository = categoryRepository; _nuGetOrgFeed = nuGetOrgFeed; }