Esempio n. 1
0
        public async Task ProvisionNewWallet()
        {
            var walletService       = new DefaultWalletService();
            var provisioningService = new DefaultProvisioningService(
                new DefaultWalletRecordService(), walletService);

            var config = new WalletConfiguration {
                Id = Guid.NewGuid().ToString()
            };
            var creds = new WalletCredentials {
                Key = "1"
            };

            await provisioningService.ProvisionAgentAsync(new ProvisioningConfiguration
            {
                WalletConfiguration = config,
                WalletCredentials   = creds,
                EndpointUri         = new Uri("http://mock")
            });

            var wallet = await walletService.GetWalletAsync(config, creds);

            Assert.NotNull(wallet);

            var provisioning = await provisioningService.GetProvisioningAsync(wallet);

            Assert.NotNull(provisioning);
            Assert.NotNull(provisioning.Endpoint);
            Assert.NotNull(provisioning.Endpoint.Did);
            Assert.NotNull(provisioning.Endpoint.Verkey);
        }
Esempio n. 2
0
        public async Task ProvisionNewWalletCanUpdateEndpoint()
        {
            var walletService       = new DefaultWalletService();
            var provisioningService = new DefaultProvisioningService(
                new DefaultWalletRecordService(), walletService);

            await provisioningService.ProvisionAgentAsync(new ProvisioningConfiguration
            {
                WalletConfiguration = _config,
                WalletCredentials   = _creds
            });

            var wallet = await walletService.GetWalletAsync(_config, _creds);

            Assert.NotNull(wallet);

            var provisioning = await provisioningService.GetProvisioningAsync(wallet);

            Assert.NotNull(provisioning);
            Assert.Null(provisioning.Endpoint.Uri);

            await provisioningService.UpdateEndpointAsync(wallet, new Models.AgentEndpoint
            {
                Uri = "http://mock"
            });

            provisioning = await provisioningService.GetProvisioningAsync(wallet);

            Assert.NotNull(provisioning);
            Assert.NotNull(provisioning.Endpoint);
            Assert.NotNull(provisioning.Endpoint.Uri);
        }
Esempio n. 3
0
        public Task InitializeAsync()
        {
            _walletService       = new DefaultWalletService();
            _provisioningService = new DefaultProvisioningService(
                new DefaultWalletRecordService(), _walletService);

            return(Task.CompletedTask);
        }
Esempio n. 4
0
        public Task InitializeAsync()
        {
            _walletService       = new DefaultWalletService();
            _provisioningService = new DefaultProvisioningService(
                new DefaultWalletRecordService(),
                _walletService,
                Options.Create(new AgentOptions
            {
                WalletConfiguration = _config,
                WalletCredentials   = _creds
            }));

            return(Task.CompletedTask);
        }
Esempio n. 5
0
        public async Task ProvisionNewWalletWithoutEndpoint()
        {
            var walletService       = new DefaultWalletService();
            var provisioningService = new DefaultProvisioningService(
                new DefaultWalletRecordService(), walletService);

            await provisioningService.ProvisionAgentAsync(new BasicProvisioningConfiguration
            {
                WalletConfiguration = _config,
                WalletCredentials   = _creds
            });

            var wallet = await walletService.GetWalletAsync(_config, _creds);

            Assert.NotNull(wallet);

            var provisioning = await provisioningService.GetProvisioningAsync(wallet);

            Assert.NotNull(provisioning);
            Assert.Null(provisioning.Endpoint.Uri);
        }
Esempio n. 6
0
 public async Task InitializeAsync()
 {
     _walletService       = new DefaultWalletService();
     _provisioningService = new DefaultProvisioningService(
         new DefaultWalletRecordService(), _walletService);
 }