public void SetUp() { packages = new List<LucenePackage>(); repository = new Mock<ILucenePackageRepository>(); controller = new TabCompletionController { Repository = repository.Object }; repository.Setup(repo => repo.LucenePackages).Returns(packages.AsQueryable()); }
public void SetUp() { packages = new List<LucenePackage>(); repository = new Mock<ILucenePackageRepository>(); mirroringRepository = new Mock<IMirroringPackageRepository>(); controller = new TabCompletionController { Repository = repository.Object, MirroringRepository = mirroringRepository.Object }; repository.Setup(repo => repo.LucenePackages).Returns(packages.AsQueryable()); mirroringRepository.Setup(repo => repo.FindPackagesById(It.IsAny<string>())) .Returns((string id) => packages.Where(p => p.Id.Equals(id, StringComparison.InvariantCultureIgnoreCase))); }