private async Task SignIn(int unitId)
        {
            var unit = await _unitService.GetUnit(unitId);

            await _unimicroClient.SignIn();

            await _unimicroClient.GetAndSetCompanyAuthorizationInfo(unit.LegalOrganizationNumber);
        }
예제 #2
0
        public async Task SetUp()
        {
            var configSettings = new Dictionary <string, string>();

            configSettings.Add(Constants.API.API_PASSWORD_CONFIG_KEY, "Sticos-integration");
            IConfiguration config = new ConfigurationBuilder()
                                    .AddJsonFile("appsettings.json", false, true)
                                    .Build();

            var serviceCollection = new ServiceCollection();

            serviceCollection.AddIocMapping();
            serviceCollection.AddHttpClient <IUnimicroClient, UnimicroClient>();
            serviceCollection.AddScoped <IConfiguration>(c => config);
            _provider = serviceCollection.BuildServiceProvider();

            _proxy = _provider.GetService <IUnimicroClient>();

            var result  = _proxy.SignIn().Result;
            var company = _proxy.GetAndSetCompanyAuthorizationInfo(_legalOrganizationNumber).Result;
        }