public ConsensusRequestMiningEventHandlerTests() { _blockchainService = GetRequiredService <IBlockchainService>(); _consensusRequestMiningEventHandler = GetRequiredService <ConsensusRequestMiningEventHandler>(); _localEventBus = GetRequiredService <ILocalEventBus>(); _testContext = GetRequiredService <KernelConsensusRequestMiningTestContext>(); }
public override void ConfigureServices(ServiceConfigurationContext context) { var services = context.Services; services.AddTransient(provider => { var mockService = new Mock <ISmartContractAddressService>(); return(mockService.Object); }); var consensusRequestMiningTestContext = new KernelConsensusRequestMiningTestContext(); services.AddSingleton(builder => { var mockConsensusService = new Mock <IConsensusService>(); consensusRequestMiningTestContext.MockConsensusService = mockConsensusService; return(mockConsensusService.Object); }); services.AddSingleton <KernelConsensusRequestMiningTestContext>(consensusRequestMiningTestContext); services.AddTransient(provider => { var mockService = new Mock <IConsensusExtraDataExtractor>(); return(mockService.Object); }); }