Exemplo n.º 1
0
        public async Task SendBlockTip_Should_Log_Error_When_Failing_To_Send_IBlockTipAsync()
        {
            TestingHttpClient.PrepareFailingHttpClient(ref this.messageHandler, ref this.httpClient, ref this.httpClientFactory);

            var restSender = new RestBlockTipSender(this.loggerFactory, this.federationSettings, this.httpClientFactory);

            var blockTip = new BlockTipModel(TestingValues.GetUint256(), TestingValues.GetPositiveInt(), TestingValues.GetPositiveInt());

            await restSender.SendBlockTipAsync(blockTip).ConfigureAwait(false);

            this.logger.Received(1).Log <object>(LogLevel.Error, 0, Arg.Any <object>(), Arg.Is <Exception>(e => e != null), Arg.Any <Func <object, Exception, string> >());
        }
Exemplo n.º 2
0
        public async Task SendMaturedBlockDeposits_Should_Log_Error_When_Failing_To_Send_MaturedBlockDepositAsync()
        {
            TestingHttpClient.PrepareFailingHttpClient(ref this.messageHandler, ref this.httpClient, ref this.httpClientFactory);

            var maturedBlockDeposits = TestingValues.GetMaturedBlockDeposits();

            var restSender = new RestMaturedBlockSender(this.loggerFactory, this.federationSettings, this.httpClientFactory);

            await restSender.SendMaturedBlockDepositsAsync(maturedBlockDeposits).ConfigureAwait(false);

            this.logger.Received(1).Log <object>(LogLevel.Error, 0, Arg.Any <object>(), Arg.Is <Exception>(e => e != null), Arg.Any <Func <object, Exception, string> >());
        }