public void Does_Not_Process_OtherTypes_Types() { var fakeRequestMessageDto = Substitute.For <IObserverDto <IMessage> >(); var correlatableHandler = new CorrelatableHandler <IMessageCorrelationManager>(_fakeMessageCorrelationManager); correlatableHandler.WriteAsync(_fakeContext, fakeRequestMessageDto); _fakeMessageCorrelationManager .DidNotReceiveWithAnyArgs() .AddPendingRequest(Arg.Any <CorrelatableMessage <ProtocolMessage> >() ); _fakeContext.ReceivedWithAnyArgs(1).WriteAsync(Arg.Any <IObserverDto <IMessage> >()); }
public async Task Does_Process_IMessageDto_Types() { var protocolMessage = new PingRequest().ToProtocolMessage(PeerIdHelper.GetPeerId("sender")); var messageDto = new MessageDto(protocolMessage, PeerIdHelper.GetPeerId("recipient")); var correlatableHandler = new CorrelatableHandler <IMessageCorrelationManager>(_fakeMessageCorrelationManager); await correlatableHandler.WriteAsync(_fakeContext, messageDto); _fakeMessageCorrelationManager .ReceivedWithAnyArgs() .AddPendingRequest(Arg.Any <CorrelatableMessage <ProtocolMessage> >() ); await _fakeContext.ReceivedWithAnyArgs(1).WriteAsync(Arg.Any <IMessageDto <ProtocolMessage> >()); }