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); }
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); }
public Task InitializeAsync() { _walletService = new DefaultWalletService(); _provisioningService = new DefaultProvisioningService( new DefaultWalletRecordService(), _walletService); return(Task.CompletedTask); }
public Task InitializeAsync() { _walletService = new DefaultWalletService(); _provisioningService = new DefaultProvisioningService( new DefaultWalletRecordService(), _walletService, Options.Create(new AgentOptions { WalletConfiguration = _config, WalletCredentials = _creds })); return(Task.CompletedTask); }
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); }
public async Task InitializeAsync() { _walletService = new DefaultWalletService(); _provisioningService = new DefaultProvisioningService( new DefaultWalletRecordService(), _walletService); }