public void TestAddNotExistingReview()
        {
            var optionsBuilder = new DbContextOptionsBuilder <HomeMyDayDbContext>();

            optionsBuilder.UseInMemoryDatabase(Guid.NewGuid().ToString());
            HomeMyDayDbContext context = new HomeMyDayDbContext(optionsBuilder.Options);

            IAccommodationRepository accommodationRepository = new EFAccommodationRepository(context);

            context.Accommodations.Add(new Accommodation()
            {
                Id      = 1,
                Name    = "TestAccommodation",
                Beds    = 6,
                Country = "Amsterdam",
                Rooms   = 3
            });

            context.SaveChanges();

            IReviewRepository repository = new EFReviewRepository(context, accommodationRepository);

            Assert.True(repository.AddReview(1, "Review Holiday 001", "TestReview", "De vakantie was goed!"));
            Assert.True(repository.GetAccomodationReviews(1).Count() == 1);
        }
Ejemplo n.º 2
0
        public void TestEmptySearchAccommodations()
        {
            var optionsBuilder = new DbContextOptionsBuilder <HomeMyDayDbContext>();

            optionsBuilder.UseInMemoryDatabase(Guid.NewGuid().ToString());
            HomeMyDayDbContext       context    = new HomeMyDayDbContext(optionsBuilder.Options);
            IAccommodationRepository repository = new EFAccommodationRepository(context);
            IReviewRepository        reviewRepo = new EFReviewRepository(context, repository);
            IAccommodationManager    manager    = new AccommodationManager(repository, reviewRepo);

            SearchController target = new SearchController(manager);

            AccommodationSearchViewModel searchModel = new AccommodationSearchViewModel()
            {
                StartDate = new DateTime(2017, 10, 12),
                EndDate   = new DateTime(2017, 10, 22),
                Location  = "Gilze",
                Persons   = 4
            };

            ViewResult result = target.Results(searchModel);
            AccommodationSearchResultsViewModel model = result.Model as AccommodationSearchResultsViewModel;

            Assert.NotNull(model);
            Assert.NotNull(model.Search);
            Assert.Empty(model.Accommodations);
            Assert.Equal(searchModel, model.Search);
            Assert.Equal("NoResults", result.ViewName);
        }
        public void TestGetExistingId()
        {
            var optionsBuilder = new DbContextOptionsBuilder <HomeMyDayDbContext>();

            optionsBuilder.UseInMemoryDatabase(Guid.NewGuid().ToString());
            HomeMyDayDbContext context = new HomeMyDayDbContext(optionsBuilder.Options);

            context.Reviews.Add(
                new Review()
            {
                Id            = 1,
                Accommodation = new Accommodation()
                {
                    Id = 1, Name = "Test"
                },
                Name     = "TestReview",
                Approved = true
            });
            context.SaveChanges();

            IReviewRepository repository = new EFReviewRepository(context, null);
            var reviews = repository.GetAccomodationReviews(1);

            Assert.NotNull(reviews.FirstOrDefault());
            Assert.Equal("Test", reviews.FirstOrDefault().Accommodation.Name);
            Assert.Equal("TestReview", reviews.FirstOrDefault().Name);
            Assert.True(reviews.Count() == 1);
        }
        public void TestFilledReviews()
        {
            var optionsBuilder = new DbContextOptionsBuilder <HomeMyDayDbContext>();

            optionsBuilder.UseInMemoryDatabase(Guid.NewGuid().ToString());
            var context = new HomeMyDayDbContext(optionsBuilder.Options);

            context.Reviews.Add(new Review()
            {
                Id            = 1,
                Name          = "TestReview",
                Accommodation = new Accommodation()
                {
                    Id = 1, Name = "TestAccommodation"
                },
                Approved = true,
                Date     = DateTime.Now,
                Title    = "Test",
                Text     = "Dit was een goede vakantie!"
            });

            context.SaveChanges();

            IReviewRepository reviewRepository = new EFReviewRepository(context, null);
            IReviewManager    reviewManager    = new ReviewManager(reviewRepository);

            var target = new ReviewController(reviewManager);

            var result = target.Index();
            var model  = result.Model as IEnumerable <ReviewViewModel>;

            Assert.NotNull(model);
            Assert.Equal("TestReview", model.FirstOrDefault().Name);
        }
        public void TestFilledSearchAccommodations()
        {
            var optionsBuilder = new DbContextOptionsBuilder <HomeMyDayDbContext>();

            optionsBuilder.UseInMemoryDatabase(Guid.NewGuid().ToString());
            HomeMyDayDbContext context = new HomeMyDayDbContext(optionsBuilder.Options);

            context.Accommodations.Add(new Accommodation()
            {
                Beds        = 4,
                Continent   = "Europe",
                Country     = "Netherlands",
                Description = "Van der Valk hotels",
                Location    = "Gilze",
                MaxPersons  = 4,
                Name        = "Van der valk Gilze",
                Rooms       = 5
            });

            context.SaveChanges();

            IAccommodationRepository repository = new EFAccommodationRepository(context);
            IReviewRepository        reviewRepo = new EFReviewRepository(context, repository);
            IAccommodationManager    manager    = new AccommodationManager(repository, reviewRepo);

            SearchBarViewComponent target = new SearchBarViewComponent(manager);

            AccommodationSearchViewModel results = (AccommodationSearchViewModel)(target.Invoke() as ViewViewComponentResult).ViewData.Model;

            Assert.NotNull(results);
            Assert.NotEmpty(results.Accommodations);
        }
        public void TestGetIdIsZeroReview()
        {
            var optionsBuilder = new DbContextOptionsBuilder <HomeMyDayDbContext>();

            optionsBuilder.UseInMemoryDatabase(Guid.NewGuid().ToString());
            HomeMyDayDbContext context  = new HomeMyDayDbContext(optionsBuilder.Options);
            var accommodationRepository = new Mock <IAccommodationRepository>();

            accommodationRepository.SetupGet(x => x.Accommodations).Returns(new List <Accommodation>()
            {
                new Accommodation()
                {
                    Id         = 1,
                    Name       = "Test",
                    Beds       = 2,
                    Country    = "Breda",
                    MaxPersons = 6
                },
                new Accommodation()
                {
                    Id         = 2,
                    Name       = "Test2",
                    Beds       = 4,
                    Country    = "Tilburg",
                    MaxPersons = 4
                }
            });

            IReviewRepository repository = new EFReviewRepository(context, accommodationRepository.Object);

            Assert.Throws <ArgumentOutOfRangeException>(() => repository.GetAccomodationReviews(0));
        }
        public void TestGetArgumentExceptionReview()
        {
            var optionsBuilder = new DbContextOptionsBuilder <HomeMyDayDbContext>();

            optionsBuilder.UseInMemoryDatabase(Guid.NewGuid().ToString());
            HomeMyDayDbContext context = new HomeMyDayDbContext(optionsBuilder.Options);

            var accommodation = new Accommodation()
            {
                Id       = 1,
                Name     = "TestAcco",
                Location = "Breda",
                Beds     = 6
            };

            context.Reviews.Add(new Review()
            {
                Id            = 1,
                Accommodation = accommodation,
                Name          = "TestReview",
                Approved      = true
            });
            context.Reviews.Add(new Review()
            {
                Id            = 2,
                Name          = "TestReview2",
                Accommodation = accommodation,
                Approved      = false
            });
            context.SaveChanges();

            IReviewRepository repository = new EFReviewRepository(context, null);

            Assert.Throws <ArgumentOutOfRangeException>(() => repository.GetAccomodationReviews(0));
        }
        public void TestAddReview()
        {
            var optionsBuilder = new DbContextOptionsBuilder <HomeMyDayDbContext>();

            optionsBuilder.UseInMemoryDatabase(Guid.NewGuid().ToString());
            var context = new HomeMyDayDbContext(optionsBuilder.Options);

            var accommodation = new Accommodation()
            {
                Id   = 1,
                Name = "TestAccommodation"
            };

            context.Accommodations.Add(accommodation);
            context.SaveChanges();

            IAccommodationRepository accommodationRepository = new EFAccommodationRepository(context);

            IReviewRepository reviewRepository = new EFReviewRepository(context, accommodationRepository);

            var dummy       = Encoding.ASCII.GetBytes("{}");
            var sessionMock = new Mock <ISession>();

            sessionMock.Setup(x => x.TryGetValue(It.IsAny <string>(), out dummy)).Returns(true).Verifiable();

            var httpContext = new DefaultHttpContext
            {
                Session = sessionMock.Object
            };

            IReviewManager reviewManager = new ReviewManager(reviewRepository);

            var target = new ReviewController(reviewManager)
            {
                TempData = new TempDataDictionary(httpContext, new SessionStateTempDataProvider())
            };

            ReviewViewModel reviewViewModelToAdd = new ReviewViewModel()
            {
                AccommodationId = accommodation.Id,
                Name            = "TestReviewAddTest",
                Approved        = true,
                Date            = DateTime.Now,
                Title           = "TestReviewAdd",
                Text            = "Dit was goed!"
            };

            var result = target.AddReview(reviewViewModelToAdd) as RedirectToActionResult;

            Assert.NotNull(result.ActionName);
            Assert.NotNull(result.ControllerName);
            Assert.Equal("Detail", result.ActionName);
            Assert.Equal("Accommodation", result.ControllerName);
        }
        public void TestGetEmptyReviewRepository()
        {
            var optionsBuilder = new DbContextOptionsBuilder <HomeMyDayDbContext>();

            optionsBuilder.UseInMemoryDatabase(Guid.NewGuid().ToString());
            HomeMyDayDbContext context = new HomeMyDayDbContext(optionsBuilder.Options);

            IReviewRepository repository = new EFReviewRepository(context, null);

            Assert.Empty(repository.GetAccomodationReviews(1));
            Assert.True(!repository.GetAccomodationReviews(1).Any());
        }
Ejemplo n.º 10
0
        public void TestFilledSearchAccommodations()
        {
            var optionsBuilder = new DbContextOptionsBuilder <HomeMyDayDbContext>();

            optionsBuilder.UseInMemoryDatabase(Guid.NewGuid().ToString());
            HomeMyDayDbContext context = new HomeMyDayDbContext(optionsBuilder.Options);

            context.Accommodations.Add(new Accommodation()
            {
                NotAvailableDates = new List <DateEntity>()
                {
                    new DateEntity()
                    {
                        Date = new DateTime(2017, 10, 11)
                    },
                    new DateEntity()
                    {
                        Date = new DateTime(2017, 10, 23)
                    },
                },
                Location   = "Amsterdam",
                MaxPersons = 4
            });

            context.SaveChanges();

            IAccommodationRepository repository = new EFAccommodationRepository(context);
            IReviewRepository        reviewRepo = new EFReviewRepository(context, repository);
            IAccommodationManager    manager    = new AccommodationManager(repository, reviewRepo);

            SearchController target = new SearchController(manager);

            AccommodationSearchViewModel searchModel = new AccommodationSearchViewModel()
            {
                StartDate = new DateTime(2017, 10, 12),
                EndDate   = new DateTime(2017, 10, 22),
                Location  = "Amsterdam",
                Persons   = 4
            };

            ViewResult result = target.Results(searchModel);
            AccommodationSearchResultsViewModel resultsModel = result.Model as AccommodationSearchResultsViewModel;

            Assert.NotNull(resultsModel);
            Assert.NotNull(resultsModel.Accommodations);
            Assert.NotEmpty(resultsModel.Accommodations);
            Assert.True(resultsModel.Accommodations.Count() == 1);
            Assert.NotNull(resultsModel.Search);
            Assert.Equal(searchModel, resultsModel.Search);
            Assert.Equal("Results", result.ViewName);
        }
        public void TestEmptySearchAccommodations()
        {
            var optionsBuilder = new DbContextOptionsBuilder <HomeMyDayDbContext>();

            optionsBuilder.UseInMemoryDatabase(Guid.NewGuid().ToString());
            HomeMyDayDbContext       context    = new HomeMyDayDbContext(optionsBuilder.Options);
            IAccommodationRepository repository = new EFAccommodationRepository(context);
            IReviewRepository        reviewRepo = new EFReviewRepository(context, repository);
            IAccommodationManager    manager    = new AccommodationManager(repository, reviewRepo);

            SearchBarViewComponent target = new SearchBarViewComponent(manager);

            AccommodationSearchViewModel results = (AccommodationSearchViewModel)(target.Invoke() as ViewViewComponentResult).ViewData.Model;

            Assert.NotNull(results);
            Assert.Empty(results.Accommodations);
        }
        public void TestEmptyReviews()
        {
            var optionsBuilder = new DbContextOptionsBuilder <HomeMyDayDbContext>();

            optionsBuilder.UseInMemoryDatabase(Guid.NewGuid().ToString());
            var context = new HomeMyDayDbContext(optionsBuilder.Options);
            IReviewRepository reviewRepository = new EFReviewRepository(context, null);
            IReviewManager    reviewManager    = new ReviewManager(reviewRepository);

            var target = new ReviewController(reviewManager);

            var result = target.Index();
            var model  = result.Model as IEnumerable <ReviewViewModel>;

            Assert.NotNull(model);
            Assert.True(!model.Any());
        }
        public void Dispose()
        {
            try
            {
                // Ensure LocalDb databases are deleted after use so that LocalDb doesn't throw if
                // the temp location in which they are stored is later cleaned.
                using (var context = new EFReviewRepository(_databaseName))
                {
                    context.Database.Delete();
                }

                _Service.Dispose();
            }
            finally
            {
                AppDomain.CurrentDomain.SetData("DataDirectory", _previousDataDirectory);
            }
        }
Ejemplo n.º 14
0
        public override void Publish(string dbconnection, string data, bool sample, bool reduced, string strategy = SqlDbConfiguration.SqlAzureExecutionStrategy)
        {
            base.Publish(dbconnection, data, sample, reduced, strategy);
            string connection = dbconnection;

            SafeWriteDebug("ConnectionString: " + connection);

            using (var db = new EFReviewRepository(connection))
            {
                if (sample)
                {
                    SafeWriteVerbose("Running sample scripts");
                    new SqlReviewSampleDatabaseInitializer().InitializeDatabase(db);
                }
                else
                {
                    SafeWriteVerbose("Running minimum scripts");
                    new SetupMigrateDatabaseToLatestVersion <EFReviewRepository, Configuration>().InitializeDatabase(db);
                }
            }
        }
        public void TestAccommodationsTrueRecommended()
        {
            var optionsBuilder = new DbContextOptionsBuilder <HomeMyDayDbContext>();

            optionsBuilder.UseInMemoryDatabase(Guid.NewGuid().ToString());
            HomeMyDayDbContext context = new HomeMyDayDbContext(optionsBuilder.Options);

            context.Accommodations.AddRange(
                new Accommodation()
            {
                Description = DEFAULT_ACCOMMODATION_DESCRIPTION, Recommended = false
            },
                new Accommodation()
            {
                Description = DEFAULT_ACCOMMODATION_DESCRIPTION, Recommended = true
            },
                new Accommodation()
            {
                Description = DEFAULT_ACCOMMODATION_DESCRIPTION, Recommended = false
            },
                new Accommodation()
            {
                Description = DEFAULT_ACCOMMODATION_DESCRIPTION, Recommended = true
            }
                );
            context.SaveChanges();

            IAccommodationRepository repository       = new EFAccommodationRepository(context);
            IReviewRepository        reviewRepository = new EFReviewRepository(context, repository);
            IAccommodationManager    manager          = new AccommodationManager(repository, reviewRepository);


            RecommendedAccommodationViewComponent component = new RecommendedAccommodationViewComponent(manager);

            IEnumerable <Accommodation> accommodations = ((IEnumerable <Accommodation>)(component.Invoke() as ViewViewComponentResult).ViewData.Model);

            Assert.True(accommodations.Count() == 2);
        }
        public void TestGetIdExistingAccommodation()
        {
            var optionsBuilder = new DbContextOptionsBuilder <HomeMyDayDbContext>();

            optionsBuilder.UseInMemoryDatabase(Guid.NewGuid().ToString());
            HomeMyDayDbContext context = new HomeMyDayDbContext(optionsBuilder.Options);

            var accommodation = new Accommodation()
            {
                Id       = 1,
                Name     = "TestAcco",
                Location = "Breda",
                Beds     = 6
            };

            context.Reviews.Add(new Review()
            {
                Id            = 1,
                Accommodation = accommodation,
                Name          = "TestReview",
                Approved      = true
            });
            context.Reviews.Add(new Review()
            {
                Id            = 2,
                Name          = "TestReview2",
                Accommodation = accommodation,
                Approved      = false
            });
            context.SaveChanges();

            IReviewRepository repository = new EFReviewRepository(context, null);
            var reviews = repository.GetAccomodationReviews(1);

            Assert.NotEmpty(reviews);
            Assert.True(reviews.Count() == 2);
            Assert.True(reviews.All(x => x.Accommodation.Id == 1));
        }
        public void TestGetIdNotExistingAccommodation()
        {
            var optionsBuilder = new DbContextOptionsBuilder <HomeMyDayDbContext>();

            optionsBuilder.UseInMemoryDatabase(Guid.NewGuid().ToString());
            HomeMyDayDbContext context = new HomeMyDayDbContext(optionsBuilder.Options);

            context.Reviews.Add(new Review()
            {
                Id            = 1,
                Accommodation = new Accommodation()
                {
                    Id = 1, Name = "Test"
                },
                Name     = "TestReview",
                Approved = true
            });
            context.SaveChanges();
            IReviewRepository repository = new EFReviewRepository(context, null);
            var reviews = repository.GetAccomodationReviews(2);

            Assert.Empty(reviews);
        }
        public void TestAddArgumentOutOfRangeExceptionReview()
        {
            var optionsBuilder = new DbContextOptionsBuilder <HomeMyDayDbContext>();

            optionsBuilder.UseInMemoryDatabase(Guid.NewGuid().ToString());
            HomeMyDayDbContext context = new HomeMyDayDbContext(optionsBuilder.Options);

            IAccommodationRepository accommodationRepository = new EFAccommodationRepository(context);

            context.Accommodations.Add(new Accommodation()
            {
                Id      = 1,
                Name    = "TestAccommodation",
                Beds    = 6,
                Country = "Amsterdam",
                Rooms   = 3
            });

            context.SaveChanges();

            IReviewRepository repository = new EFReviewRepository(context, accommodationRepository);

            Assert.Throws <ArgumentOutOfRangeException>(() => repository.AddReview(0, null, null, null));
        }
Ejemplo n.º 19
0
        /// <summary>
        /// Initializes an instance of BookingController, complete with mocked repositories and services.
        /// </summary>
        /// <param name="shouldHaveAccommodations">If true, the mocked repository will always return an accommodation. If false, always throws a KeyNotFoundException instead.</param>
        /// <returns>An instance of BookingController with mocked services.</returns>
        private BookingController GetController(bool shouldHaveAccommodations)
        {
            //Mock accommodation repo
            var accommodationRepo    = new Mock <IAccommodationRepository>();
            var reviewRepo           = new EFReviewRepository(null, accommodationRepo.Object);
            var accommodationManager = new AccommodationManager(accommodationRepo.Object, reviewRepo);

            if (shouldHaveAccommodations)
            {
                //Setup fake accommodation
                var accommodation = new Accommodation()
                {
                    Id         = 1,
                    MaxPersons = 4,
                    Name       = "Test Accommodation"
                };

                accommodationRepo.Setup(r => r.GetAccommodation(It.IsAny <long>())).Returns(accommodation);
            }
            else
            {
                //If there are no accommodations, always throw a KeyNotFoundException
                accommodationRepo.Setup(r => r.GetAccommodation(It.IsAny <long>())).Throws(new KeyNotFoundException());
            }

            //Setup fake countries
            var countries = new List <Country>()
            {
                new Country()
                {
                    Id = 1, CountryCode = "NED", Name = "Netherlands",
                },
                new Country()
                {
                    Id = 2, CountryCode = "USA", Name = "United States",
                },
                new Country()
                {
                    Id = 3, CountryCode = "NOR", Name = "Norway",
                },
            };

            //Mock country repo
            var countryRepo    = new Mock <ICountryRepository>();
            var countryManager = new CountryManager(countryRepo.Object);

            countryRepo.Setup(r => r.Countries).Returns(countries);

            //Setup fake google API options
            var fakeApiOptions = new GoogleApiServiceOptions()
            {
                ClientApiKey = "Testkey"
            };

            //Mock google api options
            var googleOpts = new Mock <IOptions <GoogleApiServiceOptions> >();

            googleOpts.Setup(g => g.Value).Returns(fakeApiOptions);
            var googleOptsManager = new GoogleMapService(googleOpts.Object);

            var sessionMock = new Mock <ISession>();

            byte[] emptyJsonObjectString = Encoding.ASCII.GetBytes("{}");
            sessionMock.Setup(s => s.TryGetValue(It.IsAny <string>(), out emptyJsonObjectString));
            sessionMock.Setup(s => s.Set(It.IsAny <string>(), It.IsAny <byte[]>()));

            //Set up a default HTTP context so the session can be mocked
            var httpContext = new DefaultHttpContext();

            httpContext.Session = sessionMock.Object;

            //Setup controller
            var controller = new BookingController(accommodationManager, countryManager, googleOptsManager);

            controller.ControllerContext = new ControllerContext()
            {
                HttpContext = httpContext,
                RouteData   = new RouteData()
            };

            return(controller);
        }
Ejemplo n.º 20
0
 public ReviewsController(EFReviewRepository db1)
 {
     this.db1 = db1;
 }
        private UnityContainer GetLocalContainer(SearchConnection searchConnection, string connectionString)
        {
            var container = new UnityContainer();

            container.RegisterType <IKnownSerializationTypes, CatalogEntityFactory>("catalog", new ContainerControlledLifetimeManager());
            container.RegisterInstance <IConsumerFactory>(new DomainAssemblyScannerConsumerFactory(container));
            container.RegisterType <IKnownSerializationTypes, DomainAssemblyScannerConsumerFactory>("scaned", new ContainerControlledLifetimeManager(), new InjectionConstructor(container));
            container.RegisterType <IConsumerFactory, DomainAssemblyScannerConsumerFactory>();
            container.RegisterType <IEngineProcess, SingleThreadConsumingProcess>();
            container.RegisterType <IMessageSerializer, DataContractMessageSerializer>();
            container.RegisterType <IQueueWriter, InMemoryQueueWriter>();
            container.RegisterType <IQueueReader, InMemoryQueueReader>();
            container.RegisterType <IMessageSender, DefaultMessageSender>(new ContainerControlledLifetimeManager());
            container.RegisterType <ICatalogEntityFactory, CatalogEntityFactory>(new ContainerControlledLifetimeManager());
            container.RegisterType <IReviewEntityFactory, ReviewEntityFactory>(new ContainerControlledLifetimeManager());

            container.RegisterType <ICatalogService, CatalogService>();
            container.RegisterType <ISearchIndexBuilder, CatalogItemIndexBuilder>("catalogitem");
            container.RegisterType <ILogOperationFactory, LogOperationFactory>();
            container.RegisterType <ISearchEntityFactory, SearchEntityFactory>(new ContainerControlledLifetimeManager());
            container.RegisterType <ISearchIndexController, SearchIndexController>();
            container.RegisterType <ICacheRepository, HttpCacheRepository>();

            if (string.Equals(searchConnection.Provider, SearchProviders.Lucene.ToString(), StringComparison.OrdinalIgnoreCase))
            {
                // Lucene Search implementation
                container.RegisterType <ISearchProvider, LuceneSearchProvider>();
                container.RegisterType <ISearchQueryBuilder, LuceneSearchQueryBuilder>();
            }
            else if (string.Equals(searchConnection.Provider, SearchProviders.AzureSearch.ToString(), StringComparison.OrdinalIgnoreCase))
            {
                // Azure Search implementation
                container.RegisterType <ISearchProvider, AzureSearchProvider>();
                container.RegisterType <ISearchQueryBuilder, AzureSearchQueryBuilder>();
            }
            else
            {
                container.RegisterType <ISearchProvider, ElasticSearchProvider>();
                container.RegisterType <ISearchQueryBuilder, ElasticSearchQueryBuilder>();
            }


            // register instances here
            container.RegisterInstance <ISearchConnection>(searchConnection);

            var catalogRepository = new EFCatalogRepository(connectionString);

            container.RegisterInstance <ICatalogRepository>(catalogRepository);
            container.RegisterType <ICatalogOutlineBuilder, CatalogOutlineBuilder>();
            container.RegisterInstance <IPricelistRepository>(catalogRepository);
            container.RegisterInstance <IOperationLogRepository>(new OperationLogContext(connectionString));
            container.RegisterInstance <IBuildSettingsRepository>(new EFSearchRepository(connectionString));

            var reviewRepository = new EFReviewRepository(connectionString);

            container.RegisterInstance <IReviewRepository>(reviewRepository);


            var indexingProgress = new ProgressRecord(1, "Indexing Progress", "Progress:");
            var observer         = new ProgressObserver(this, indexingProgress);

            container.RegisterInstance <ISystemObserver>(observer);

            return(container);
        }