Exemplo n.º 1
0
        public void ReserveMultipleFragmentsOpaque(int maxReadLength, int maxReserveLength)
        {
            var stubNetwork = new StubNetwork(maxReadLength, maxReserveLength);
            var reader      = new XdrReader(stubNetwork);
            var writer      = new XdrWriter(stubNetwork);

            byte[] value = GenerateByteTestData(21);
            writer.WriteVariableLengthOpaque(value);
            writer.Write(42);

            Assert.That(stubNetwork.WriteIndex, Is.EqualTo(32));
            Assert.That(reader.ReadOpaque(), Is.EqualTo(value));
            Assert.That(reader.ReadInt(), Is.EqualTo(42));
        }
Exemplo n.º 2
0
 public TestXdr()
 {
     this.stubNetwork = new StubNetwork(65536, 65536);
     this.reader      = new XdrReader(this.stubNetwork);
     this.writer      = new XdrWriter(this.stubNetwork);
 }