public void Init()
        {
            _generatorRepository = Substitute.For <IEntityBaseRepository <Generator> >();
            _generatorAvailableVoltageRepository    = Substitute.For <IEntityBaseRepository <GeneratorAvailableVoltage> >();
            _generatorRegulatoryFilterRepository    = Substitute.For <IEntityBaseRepository <GeneratorRegulatoryFilter> >();
            _generatorAvailableAlternatorRepository = Substitute.For <IEntityBaseRepository <GeneratorAvailableAlternator> >();
            _alternatorFamilyRepository             = Substitute.For <IEntityBaseRepository <AlternatorFamily> >();
            _generatorEntityToGeneratorDtoMapper    = Substitute.ForPartsOf <AutoMapper <Generator, GeneratorDto> >();
            _addGeneratorDtoToEntityMapper          = Substitute.ForPartsOf <AutoMapper <GeneratorDto, Generator> >();
            _alternatorRepository = Substitute.For <IEntityBaseRepository <Alternator> >();
            _alternatorEntityToAlternatorDtoMapper = Substitute.ForPartsOf <AutoMapper <Alternator, AlternatorDto> >();
            _addAlternatorDtoToEntityMapper        = Substitute.ForPartsOf <AutoMapper <AlternatorDto, Alternator> >();
            _productFamilyRepository = Substitute.For <IEntityBaseRepository <ProductFamily> >();
            _addImportGensetDataRequestDtoToGeneratorEntityMapper = Substitute.ForPartsOf <AutoMapper <ImportGensetDataRequestDto, Generator> >();
            _regulatoryFilterRepository = Substitute.For <IEntityBaseRepository <RegulatoryFilter> >();
            _frequencyRepository        = Substitute.For <IEntityBaseRepository <Frequency> >();
            _fuelTypeRepository         = Substitute.For <IEntityBaseRepository <FuelType> >();
            _addImportAlternatorDataRequestDtoToAlternatorEntityMapper = Substitute.ForPartsOf <AutoMapper <ImportAlternatorDataRequestDto, Alternator> >();
            _voltagePhaseRepository        = Substitute.For <IEntityBaseRepository <VoltagePhase> >();
            _voltageNominalRepository      = Substitute.For <IEntityBaseRepository <VoltageNominal> >();
            _brandRepository               = Substitute.For <IEntityBaseRepository <Brand> >();
            _solutionApplicationRepository = Substitute.For <IEntityBaseRepository <SolutionApplication> >();
            _documentationRepository       = Substitute.For <IEntityBaseRepository <Documentation> >();
            _harmonicDeviceTypeRepository  = Substitute.For <IEntityBaseRepository <HarmonicDeviceType> >();
            _harmonicDeviceTypeEntityToHarmonicDeviceTypeDtoMapper = Substitute.ForPartsOf <AutoMapper <HarmonicDeviceType, HarmonicDeviceTypeDto> >();
            _addHarmonicDeviceDtoToEntityMapper = Substitute.ForPartsOf <AutoMapper <HarmonicDeviceTypeDto, HarmonicDeviceType> >();

            _adminProcessor = Substitute.For <AdminProcessor>
                              (
                _generatorRepository,
                _generatorEntityToGeneratorDtoMapper,
                _alternatorRepository,
                _alternatorFamilyRepository,
                _alternatorEntityToAlternatorDtoMapper,
                _addAlternatorDtoToEntityMapper,
                _addGeneratorDtoToEntityMapper,
                _generatorAvailableVoltageRepository,
                _generatorRegulatoryFilterRepository,
                _productFamilyRepository,
                _addImportGensetDataRequestDtoToGeneratorEntityMapper,
                _generatorAvailableAlternatorRepository,
                _regulatoryFilterRepository,
                _frequencyRepository,
                _fuelTypeRepository,
                _addImportAlternatorDataRequestDtoToAlternatorEntityMapper,
                _voltagePhaseRepository,
                _voltageNominalRepository,
                _brandRepository,
                _solutionApplicationRepository,
                _documentationRepository,
                _harmonicDeviceTypeRepository,
                _harmonicDeviceTypeEntityToHarmonicDeviceTypeDtoMapper,
                _addHarmonicDeviceDtoToEntityMapper
                              );
        }
Esempio n. 2
0
        public IActionResult Login(Admin admin)
        {
            AdminModel adminModel = AdminProcessor.AuthoriseAdmin(admin.Username, admin.Password);

            if (adminModel != null)
            {
                SessionController.Login(HttpContext.Session, adminModel);
                return(RedirectToAction("Index"));
            }

            ViewData["ErrorMessage"] = "Incorrect login details";
            return(View());
        }
 public bool PostJob(PostedJobs postjob)
 {
     return(AdminProcessor.PostJob(postjob));
 }
 public bool AddCategory(Category category)
 {
     return(AdminProcessor.AddCategory(category));
 }
 public int GetID(String Email)
 {
     return(AdminProcessor.GetID(Email));
 }
 public bool LoginAdmin(Admin admin)
 {
     return(AdminProcessor.Login(admin.Email, admin.Password));
 }
 public bool SignUpAdmin(Admin admin)
 {
     return(AdminProcessor.SignUp(admin));
 }