private void SetupDevEnv() { InsertSeedRecords(); var catalog = LookupRepo.GetEntities <NoteCatalog>() .FirstOrDefault(c => c.Name == AutomobileConstant.GasDiscountCatalogName); Assert.NotNull(catalog); var noteSerializer = new GasDiscountXmlNoteSerializer(Application, new NullLogger <GasDiscount>(), LookupRepo); var noteManager = new HmmNoteManager(NoteRepository, new NoteValidator(NoteRepository), DateProvider); _manager = new DiscountManager(noteSerializer, new GasDiscountValidator(LookupRepo), noteManager, LookupRepo); _authorId = ApplicationRegister.DefaultAuthor.Id; }
private void SetupTestEnv() { InsertSeedRecords(); var noteManager = new HmmNoteManager(NoteRepository, new NoteValidator(NoteRepository), DateProvider); // sub system manager _systemManager = new SubsystemManager(SubsystemRepository, new SubsystemValidator(AuthorRepository)); // automobile manager var noteSerializer = new AutomobileXmlNoteSerializer(Application, new NullLogger <AutomobileInfo>(), LookupRepo); _automobileManager = new AutomobileManager(noteSerializer, new AutomobileValidator(LookupRepo), noteManager, LookupRepo); // gas discount manager var discountNoteSerializer = new GasDiscountXmlNoteSerializer(Application, new NullLogger <GasDiscount>(), LookupRepo); _discountManager = new DiscountManager(discountNoteSerializer, new GasDiscountValidator(LookupRepo), noteManager, LookupRepo); var config = new ConfigurationBuilder() .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) .Build(); var myConfig = (IConfiguration)config; _application = new ApplicationRegister(myConfig); }