Beispiel #1
0
        public void ConstantFieldMemberValidValues()
        {
            var         message = new MessageWithConstantField();
            MessagePart part    = GetMessagePart(message.GetType(), "ConstantField");

            Assert.AreEqual("abc", part.GetValue(message));
            part.SetValue(message, "abc");
            Assert.AreEqual("abc", part.GetValue(message));
        }
Beispiel #2
0
        public void GetValue()
        {
            var message = new MessageWithNonNullableRequiredStruct();

            message.OptionalInt = 8;
            MessagePart part = this.ParameterizedMessageTypeTest(message.GetType());

            Assert.AreEqual("8", part.GetValue(message));
        }
Beispiel #3
0
        public void Base64Member()
        {
            var message = new MessageWithBase64EncodedString();

            message.LastName = "andrew";
            MessagePart part = GetMessagePart(message.GetType(), "nameBytes");

            Assert.AreEqual("YW5kcmV3", part.GetValue(message));
            part.SetValue(message, "YXJub3R0");
            Assert.AreEqual("arnott", message.LastName);
        }