public void Initialize() { IEnumerable<ProductSearchResult> fakeDbProductResults = new List<ProductSearchResult> { new ProductSearchResult("CABLE.7/0.20 X 3P OVERALL SCREENED","ELEEAS7203P",40354), new ProductSearchResult("CABLE.7/0.20 X 3P OVERALL SCREENED","ELEEAS7203P",40355), new ProductSearchResult("ELBOW.M16 90DEG NICKLE PLATED BRASS","FLEBM90-16M",40356), new ProductSearchResult("ELBOW.M32 90DEG NICKLE PLATED BRASS 20'","FLEBM90-32M",40357), new ProductSearchResult("CONDUIT.FSU(20MM) GALV-STL/PVC 10M BLACK","FLEFSU20B-10M",40358), new ProductSearchResult("CONDUIT.FSU(25MM) GALV-STL/PVC 25M BLACK","FLEFSU25B-25M",40359) }; var productRepository = Substitute.For<IProductRepository>(); productRepository.GetAllProductSearchResults().ReturnsForAnyArgs(fakeDbProductResults); // ------------ _searcher = new ProductSearcher(productRepository); _searcher.LoadProductStore(_lucenePath, 100, 0.5f, false); }