public void Setup() { AutofacConfig.RegisterTypes(); var stratisEndPoint = new StratisEndPointAdhocService(); var rsaEngine = new EncryptDecrypt(); _moocMicroCredentialProvider = new MoocMicroCredentialProvider(stratisEndPoint, rsaEngine); _employeeOperations = new EmployeeOperations(stratisEndPoint, rsaEngine, _moocMicroCredentialProvider); _employerOperations = new EmployerOperations(stratisEndPoint, rsaEngine, _moocMicroCredentialProvider); }
public EmployerController(UnitOfWork unitOfWork, ApplicationUserManager userManager) { _roleManager = new RoleManager <IdentityRole>(new RoleStore <IdentityRole>(new ApplicationDbContext())); _unitOfWork = unitOfWork; _unitOfWork.UniSADbContext = new UniSA.DataAccess.UniSADbContext(); var stratisEndPoint = new StratisEndPointAdhocService(); var moocMicroCredentialProvider = new MoocMicroCredentialProvider(new StratisEndPointAdhocService(), new EncryptDecrypt()); var employerProvider = new EmployerOperations(stratisEndPoint, new EncryptDecrypt(), moocMicroCredentialProvider); HttpClient client = new HttpClient(); client.BaseAddress = new Uri(ConfigurationManager.AppSettings["StratisBlockChainBaseUrl"]); var stratisApiRequests = new UniSA.Services.StratisBlockChainServices.StratisApi.StratisApiFullfilRequestComponent(client);; moocMicroCredentialProvider.StratisApiFullfilRequestComponent = stratisApiRequests; _repositoryEndPointService = new RepositoryEndPointServices(_unitOfWork, moocMicroCredentialProvider); _repositoryEndPointService.EmployerOperations = employerProvider; moocMicroCredentialProvider.RepositoryEndPointService = _repositoryEndPointService; employerProvider.RepositoryEndPointService = _repositoryEndPointService; employerProvider.StratisApiFullfilRequestComponent = stratisApiRequests; _userManager = userManager; }