コード例 #1
0
        public void ConstantFieldMemberInvalidValues()
        {
            var         message = new MessageWithConstantField();
            MessagePart part    = GetMessagePart(message.GetType(), "ConstantField");

            part.SetValue(message, "def");
        }
コード例 #2
0
        public void SetValue()
        {
            var         message = new MessageWithNonNullableRequiredStruct();
            MessagePart part    = this.ParameterizedMessageTypeTest(message.GetType());

            part.SetValue(message, "5");
            Assert.AreEqual(5, message.OptionalInt);
        }
コード例 #3
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));
        }
コード例 #4
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);
        }