Пример #1
0
 public void Initialize()
 {
     this._bufferManager = new PoxBufferManager();
     this._property = new DisposableProperty();
     PoxBinaryMessageEncodingBindingElement pox = new PoxBinaryMessageEncodingBindingElement();
     MessageEncoderFactory factory = pox.CreateMessageEncoderFactory();
     this._encoder = factory.Encoder;
     this._simpleMessageArray = this.GetMessageArray(this._simpleMessageString);
 }
Пример #2
0
        public void Initialize()
        {
            this._bufferManager = new PoxBufferManager();
            this._property      = new DisposableProperty();
            PoxBinaryMessageEncodingBindingElement pox = new PoxBinaryMessageEncodingBindingElement();
            MessageEncoderFactory factory = pox.CreateMessageEncoderFactory();

            this._encoder            = factory.Encoder;
            this._simpleMessageArray = this.GetMessageArray(this._simpleMessageString);
        }
Пример #3
0
        public void PoxBufferedMessage_GetReader()
        {
            PoxBinaryMessageEncodingBindingElement pox = new PoxBinaryMessageEncodingBindingElement();

            pox.ReaderQuotas.MaxArrayLength         = 1;
            pox.ReaderQuotas.MaxBytesPerRead        = 1;
            pox.ReaderQuotas.MaxDepth               = 1;
            pox.ReaderQuotas.MaxNameTableCharCount  = 1;
            pox.ReaderQuotas.MaxStringContentLength = 1;
            MessageEncoderFactory factory = pox.CreateMessageEncoderFactory();

            this._encoder = factory.Encoder;

            // Test that the XmlDictionaryReaderQuotas propagate to the XmlDictionaryReader.
            using (Message message = this.GetMessage())
                using (XmlDictionaryReader reader = message.GetReaderAtBodyContents())
                {
                    Assert.AreEqual(1, reader.Quotas.MaxArrayLength, "MaxArrayLength");
                    Assert.AreEqual(1, reader.Quotas.MaxBytesPerRead, "MaxBytesPerRead");
                    Assert.AreEqual(1, reader.Quotas.MaxDepth, "MaxDepth");
                    Assert.AreEqual(1, reader.Quotas.MaxNameTableCharCount, "MaxNameTableCharCount");
                    Assert.AreEqual(1, reader.Quotas.MaxStringContentLength, "MaxStringContentLength");
                }
        }
Пример #4
0
        public void PoxBufferedMessage_GetReader()
        {
            PoxBinaryMessageEncodingBindingElement pox = new PoxBinaryMessageEncodingBindingElement();
            pox.ReaderQuotas.MaxArrayLength = 1;
            pox.ReaderQuotas.MaxBytesPerRead = 1;
            pox.ReaderQuotas.MaxDepth = 1;
            pox.ReaderQuotas.MaxNameTableCharCount = 1;
            pox.ReaderQuotas.MaxStringContentLength = 1;
            MessageEncoderFactory factory = pox.CreateMessageEncoderFactory();
            this._encoder = factory.Encoder;

            // Test that the XmlDictionaryReaderQuotas propagate to the XmlDictionaryReader.
            using (Message message = this.GetMessage())
            using (XmlDictionaryReader reader = message.GetReaderAtBodyContents())
            {
                Assert.AreEqual(1, reader.Quotas.MaxArrayLength, "MaxArrayLength");
                Assert.AreEqual(1, reader.Quotas.MaxBytesPerRead, "MaxBytesPerRead");
                Assert.AreEqual(1, reader.Quotas.MaxDepth, "MaxDepth");
                Assert.AreEqual(1, reader.Quotas.MaxNameTableCharCount, "MaxNameTableCharCount");
                Assert.AreEqual(1, reader.Quotas.MaxStringContentLength, "MaxStringContentLength");
            }
        }