public void AssociateRJ_Write_BytesCorrectlyWritten(byte[] expected, AAssociateRJ reject, string _) { using var raw = reject.Write(); using var stream = new MemoryStream(); raw.WritePDU(stream); var actual = stream.ToArray(); Assert.Equal(expected, actual); }
public void AssociateRJ_Read_ReasonGivenByContext(byte[] buffer, AAssociateRJ _, string expected) { using var raw = new RawPDU(buffer); var reject = new AAssociateRJ(); reject.Read(raw); var actual = reject.Reason.ToString(); Assert.Equal(expected, actual); }
internal virtual void Write(AAssociateRJ rj) { throw new SystemException(); }
public void Write(AAssociateRJ rj) { FireWrite(rj); try { lock (stream) { state.Write(rj); } } catch (IOException ioe) { if (assocListener != null) { assocListener.Error(assoc, ioe); } throw ioe; } }
internal override void Write(AAssociateRJ rj) { try { rj.WriteTo(m_fsm.stream); } catch (IOException e) { m_fsm.ChangeState(m_fsm.STA1); throw e; } m_fsm.ChangeState(m_fsm.STA13); }
public async Task AssociateRJ_WriteAsync_BytesCorrectlyWritten(byte[] expected, AAssociateRJ reject, string _) { using (var raw = reject.Write()) using (var stream = new MemoryStream()) { await raw.WritePDUAsync(stream); var actual = stream.ToArray(); Assert.Equal(expected, actual); } }