Beispiel #1
0
        private CatalogService GetTestCatalogService(string databaseName, out DaoRepository daoRepository)
        {
            Database testDatabase = DataProvider.Current.GetAppDatabase(databaseName);

            Log.Default   = new ConsoleLogger();
            daoRepository = new DaoRepository(testDatabase, Log.Default);
            IRepository catalogRepo = daoRepository;
            ApplicationRegistrationRepository applicationRegistrationRepository = new ApplicationRegistrationRepository();
            AsyncCallbackService asyncCallbackService = Substitute.For <AsyncCallbackService>();
            CatalogService       svc = new CatalogService(catalogRepo, asyncCallbackService, daoRepository, new AppConf())
            {
                ApplicationRegistrationRepository = applicationRegistrationRepository
            };

            daoRepository.DeleteAll <CatalogDefinition>();
            daoRepository.DeleteAll <CatalogItem>();
            daoRepository.DeleteAll <ItemDefinition>();
            daoRepository.DeleteAll <ItemOption>();
            daoRepository.DeleteAll <ItemProperty>();
            return(svc);
        }