public void AcceptStream() { var systemDiagnostics = new SystemDiagnostics((p, s) => { }, null); var msg = new StreamData { Data = new MemoryStream(), }; var endpoint = new DataReceivingEndpoint(systemDiagnostics); endpoint.OnNewData += (s, e) => Assert.AreSame(msg.Data, e.Data.Data); endpoint.AcceptStream(msg); }
public void AcceptStreamThrowingException() { var systemDiagnostics = new SystemDiagnostics((p, s) => { }, null); var msg = new StreamData { Data = new MemoryStream(), }; var endpoint = new DataReceivingEndpoint(systemDiagnostics); endpoint.OnNewData += (s, e) => { throw new Exception(); }; Assert.DoesNotThrow(() => endpoint.AcceptStream(msg)); }