public EphemeralChallengeTests()
        {
            var recordService = new DefaultWalletRecordService();
            var ledgerService = new DefaultLedgerService();

            var eventAggregator = new EventAggregator();

            var routingMock = new Mock <IMessageService>();

            routingMock.Setup(x =>
                              x.SendAsync(It.IsAny <Wallet>(), It.IsAny <AgentMessage>(), It.IsAny <ConnectionRecord>(), It.IsAny <string>(), It.IsAny <bool>()))
            .Callback((Wallet _, AgentMessage content, ConnectionRecord __, string ___, bool ____) =>
            {
                if (_routeMessage)
                {
                    _messages.Add(content);
                }
                else
                {
                    throw new AgentFrameworkException(ErrorCode.LedgerOperationRejected, "");
                }
            })
            .Returns(Task.FromResult <MessageContext>(null));

            var provisioningMock = ServiceUtils.GetDefaultMockProvisioningService();

            var tailsService = new DefaultTailsService(ledgerService, new HttpClientHandler());

            _schemaService = new DefaultSchemaService(provisioningMock, recordService, ledgerService, tailsService);

            _connectionService = new DefaultConnectionService(
                eventAggregator,
                recordService,
                provisioningMock,
                new Mock <ILogger <DefaultConnectionService> >().Object);

            _credentialService = new DefaultCredentialService(
                eventAggregator,
                ledgerService,
                _connectionService,
                recordService,
                _schemaService,
                tailsService,
                provisioningMock,
                new Mock <ILogger <DefaultCredentialService> >().Object);

            _proofService = new DefaultProofService(
                eventAggregator,
                _connectionService,
                recordService,
                provisioningMock,
                ledgerService,
                tailsService,
                new Mock <ILogger <DefaultProofService> >().Object);

            _ephemeralChallengeService = new DefaultEphemeralChallengeService(eventAggregator, _proofService, recordService, provisioningMock, new Mock <ILogger <DefaultEphemeralChallengeService> >().Object);
        }
Esempio n. 2
0
 /// <summary>Initializes a new instance of the <see cref="DefaultEphemeralChallengeHandler"/> class.</summary>
 /// <param name="ephemeralChallengeService">The ephemeral challenge service.</param>
 public DefaultEphemeralChallengeHandler(IEphemeralChallengeService ephemeralChallengeService)
 {
     _ephemeralChallengeService = ephemeralChallengeService;
 }