Ejemplo n.º 1
0
        public GasDiscountController(IAutoEntityManager <GasDiscount> discountManager, IMapper mapper)
        {
            Guard.Against <ArgumentNullException>(discountManager == null, nameof(discountManager));
            Guard.Against <ArgumentNullException>(mapper == null, nameof(mapper));

            _discountManager = discountManager;
            _mapper          = mapper;
        }
Ejemplo n.º 2
0
        public AutomobileController(IAutoEntityManager <AutomobileInfo> automobileManager, IMapper mapper, ILogger <AutomobileController> logger)
        {
            Guard.Against <ArgumentNullException>(automobileManager == null, nameof(automobileManager));
            Guard.Against <ArgumentNullException>(mapper == null, nameof(mapper));
            Guard.Against <ArgumentNullException>(logger == null, nameof(logger));

            _automobileManager = automobileManager;
            _mapper            = mapper;
        }
Ejemplo n.º 3
0
 public GasLogManager(INoteSerializer <GasLog> noteSerializer, IHmmValidator <GasLog> validator, IHmmNoteManager noteManager, IAutoEntityManager <AutomobileInfo> autoManager, IEntityLookup lookupRepo, IDateTimeProvider dateProvider)
     : base(validator, noteManager, lookupRepo)
 {
     Guard.Against <ArgumentNullException>(autoManager == null, nameof(autoManager));
     Guard.Against <ArgumentNullException>(noteSerializer == null, nameof(noteSerializer));
     Guard.Against <ArgumentNullException>(dateProvider == null, nameof(dateProvider));
     _autoManager   = autoManager;
     NoteSerializer = noteSerializer;
     _dateProvider  = dateProvider;
 }
Ejemplo n.º 4
0
        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;
        }
Ejemplo n.º 5
0
        private void SetupDevEnv()
        {
            InsertSeedRecords();

            // add testing note catalog
            var catalog = LookupRepo.GetEntities <NoteCatalog>()
                          .FirstOrDefault(c => c.Name == AutomobileConstant.AutoMobileInfoCatalogName);

            Assert.NotNull(catalog);
            var noteSerializer = new AutomobileXmlNoteSerializer(Application, new NullLogger <AutomobileInfo>(), LookupRepo);
            var noteManager    = new HmmNoteManager(NoteRepository, new NoteValidator(NoteRepository), DateProvider);

            _manager = new AutomobileManager(noteSerializer, new AutomobileValidator(LookupRepo), noteManager, LookupRepo);
        }
Ejemplo n.º 6
0
        public GasLogXmlNoteSerializer(
            IApplication app,
            ILogger <GasLog> logger,
            IAutoEntityManager <AutomobileInfo> autoManager,
            IAutoEntityManager <GasDiscount> discountManager,
            IEntityLookup lookupRepo)
            : base(logger)
        {
            Guard.Against <ArgumentNullException>(app == null, nameof(app));
            Guard.Against <ArgumentNullException>(autoManager == null, nameof(autoManager));
            Guard.Against <ArgumentNullException>(discountManager == null, nameof(discountManager));
            Guard.Against <ArgumentNullException>(lookupRepo == null, nameof(lookupRepo));

            _app             = app;
            _autoManager     = autoManager;
            _discountManager = discountManager;
            _lookupRepo      = lookupRepo;
        }
Ejemplo n.º 7
0
        public GasLogController(IGasLogManager gasLogManager, IMapper mapper,
                                IAutoEntityManager <AutomobileInfo> autoManager,
                                IAutoEntityManager <GasDiscount> discountManager,
                                IPropertyMappingService propertyMappingService,
                                IPropertyCheckService propertyCheckService)
        {
            Guard.Against <ArgumentNullException>(gasLogManager == null, nameof(gasLogManager));
            Guard.Against <ArgumentNullException>(mapper == null, nameof(mapper));
            Guard.Against <ArgumentNullException>(autoManager == null, nameof(autoManager));
            Guard.Against <ArgumentNullException>(discountManager == null, nameof(discountManager));
            Guard.Against <ArgumentNullException>(propertyMappingService == null, nameof(propertyMappingService));
            Guard.Against <ArgumentNullException>(propertyCheckService == null, nameof(propertyCheckService));

            _gasLogManager          = gasLogManager;
            _mapper                 = mapper;
            _autoManager            = autoManager;
            _discountManager        = discountManager;
            _propertyMappingService = propertyMappingService;
            _propertyCheckService   = propertyCheckService;
        }
Ejemplo n.º 8
0
        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);
        }