public void AcceptMessageThrowingException() { var systemDiagnostics = new SystemDiagnostics((p, s) => { }, null); var endpointId = new EndpointId("id"); var msg = new EndpointDisconnectData { Sender = endpointId, }; var endpoint = new MessageReceivingEndpoint( new IConvertCommunicationMessages[] { new EndpointDisconnectConverter(), }, systemDiagnostics); endpoint.OnNewMessage += (s, e) => { throw new Exception(); }; Assert.DoesNotThrow(() => endpoint.AcceptMessage(msg)); }
public void AcceptMessage() { var systemDiagnostics = new SystemDiagnostics((p, s) => { }, null); var endpointId = new EndpointId("id"); var msg = new EndpointDisconnectData { Sender = endpointId, }; var endpoint = new MessageReceivingEndpoint( new IConvertCommunicationMessages[] { new EndpointDisconnectConverter(), }, systemDiagnostics); endpoint.OnNewMessage += (s, e) => Assert.IsInstanceOf(typeof(EndpointDisconnectMessage), e.Message); endpoint.AcceptMessage(msg); }