public void DefaultValuesForCustom()
        {
            var n = new NetPeerTcpBinding();

            n.Resolver.Mode            = PeerResolverMode.Custom;
            n.Resolver.Custom.Resolver = new DummyResolver();

            Assert.AreEqual(EnvelopeVersion.Soap12, n.EnvelopeVersion, "#1");
            Assert.IsNull(n.ListenIPAddress, "#2");
            Assert.AreEqual(0x10000, n.MaxReceivedMessageSize, "#3");
            Assert.AreEqual(0, n.Port, "#4");
            Assert.IsNotNull(n.ReaderQuotas, "#5");

            Assert.IsFalse(((IBindingRuntimePreferences)n).ReceiveSynchronously, "#6");

            var bec = n.CreateBindingElements();

            Assert.IsNotNull(bec.Find <PeerCustomResolverBindingElement> (), "#bec0");
            Assert.IsNotNull(bec.Find <BinaryMessageEncodingBindingElement> (), "#bec1");
            Assert.AreEqual(3, bec.Count, "#bec2");

            var tr = bec.Find <PeerTransportBindingElement> ();

            Assert.IsNotNull(tr, "#tr1");
        }
        public void DefaultValues()
        {
            if (!NetPeerTcpBinding.IsPnrpAvailable)
            {
                return; // yes, we actually don't test it.
            }
            var n = new NetPeerTcpBinding();

            Assert.AreEqual(EnvelopeVersion.Soap12, n.EnvelopeVersion, "#1");
            Assert.IsNull(n.ListenIPAddress, "#2");
            Assert.AreEqual(0x10000, n.MaxReceivedMessageSize, "#3");
            Assert.AreEqual(0, n.Port, "#4");
            Assert.IsNotNull(n.ReaderQuotas, "#5");

            var bec = n.CreateBindingElements();

            Assert.IsNotNull(bec.Find <PnrpPeerResolverBindingElement> (), "#bec0");
            Assert.IsNotNull(bec.Find <BinaryMessageEncodingBindingElement> (), "#bec1");
            Assert.AreEqual(3, bec.Count, "#bec2");

            var tr = bec.Find <PeerTransportBindingElement> ();

            Assert.IsNotNull(tr, "#tr1");
        }