public void protocol_initialized_event_should_be_handled() { var protocolHandler = Substitute.For <IProtocolHandler>(); var session = Substitute.For <ISession>(); var node = new Node("127.0.0.1", 8545); session.Node.Returns(node); _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.DidNotReceiveWithAnyArgs().UpdateFaucet(Arg.Any <INdmPeer>()); }