public TransactionConfirmationWatcherTests() { this.callbackRepository = Substitute.For <ICallbackRepository>(); this.ruleRepository = Substitute.ForPartsOf <FakeRuleRepository>(); this.blockStorage = Substitute.For <IBlocksStorage>(); this.blockStorage .GetAsync(Arg.Any <uint256>(), Arg.Any <CancellationToken>()) .Returns(info => mockedBlocks[info.ArgAt <uint256>(0)].ToValueTuple()); this.callbackExecuter = Substitute.For <ICallbackExecuter>(); this.logger = Substitute.For <ILogger <TransactionConfirmationWatcher> >(); this.watchRepository = new FakeWatchRepository(); this.handler = this.subject = new TransactionConfirmationWatcher ( this.callbackRepository, this.ruleRepository, this.blockStorage, this.callbackExecuter, this.watchRepository, this.logger ); this.blockListener = this.subject; this.defaultUrl = new Uri("http://zcoin.io"); MockCallbackRepository(); }
public TransactionConfirmationWatcher( ITransactionConfirmationWatcherHandler <TContext> handler, IBlocksStorage blocks) : base(handler, blocks) { if (handler == null) { throw new ArgumentNullException(nameof(handler)); } this.handler = handler; }