public void protocol_initialized_event_should_be_and_set_to_faucet_if_host_address_doest_match() { var protocolHandler = Substitute.For <IProtocolHandler, INdmPeer>(); const string host = "127.0.0.1"; var node = new Node(host, 8545); var session = new Session(8545, node, Substitute.For <IChannel>(), NullDisconnectsAnalyzer.Instance, LimboLogs.Instance); _ethRequestService.FaucetHost.Returns(host); _subprotocolFactory.Create(session).Returns(protocolHandler); _factory.Create(session); var eventArgs = new NdmProtocolInitializedEventArgs(protocolHandler); protocolHandler.ProtocolInitialized += Raise.EventWith(protocolHandler, (ProtocolInitializedEventArgs)eventArgs); _subprotocolFactory.Received().Create(session); _protocolValidator.Received().DisconnectOnInvalid(Protocol.Ndm, session, eventArgs); _ethRequestService.Received().UpdateFaucet(protocolHandler as INdmPeer); }