public async Task ThrowsBlockNotFoundException() { //setup Web3Mock.GetBlockWithTransactionsByNumberMock .Setup(p => p.SendRequestAsync(BlockNumber.ToHexBigInteger(), null)) .ReturnsAsync((BlockWithTransactions)null); //execute await Assert.ThrowsAsync <BlockNotFoundException>( async() => await BlockProcessor.ProcessBlockAsync(BlockNumber)); }
public WhenBlockIsNotNull() { _stubBlock = new BlockWithTransactions { Number = new HexBigInteger(BlockNumber), Transactions = new[] { new Transaction { TransactionHash = TxHash1 }, new Transaction { TransactionHash = TxHash2 } } }; Web3Mock.GetBlockWithTransactionsByNumberMock .Setup(p => p.SendRequestAsync(BlockNumber.ToHexBigInteger(), null)) .ReturnsAsync(_stubBlock); }