コード例 #1
0
        public void ResolveWithPayloadTypeAsWildcardAndNoConverter()
        {
            resolver = new MessageMethodArgumentResolver();

            var message   = MessageBuilder.WithPayload("test").Build();
            var parameter = method.GetParameters()[0];

            Assert.True(resolver.SupportsParameter(parameter));
            Assert.Same(message, resolver.ResolveArgument(parameter, message));
        }
コード例 #2
0
        public void ResolveWithConversionNeededButNoConverter()
        {
            resolver = new MessageMethodArgumentResolver();

            var message   = MessageBuilder.WithPayload("test").Build();
            var parameter = method.GetParameters()[1];

            Assert.True(resolver.SupportsParameter(parameter));
            var ex = Assert.Throws <MessageConversionException>(() => resolver.ResolveArgument(parameter, message));

            Assert.Contains("Int32", ex.Message);
            Assert.Contains("String", ex.Message);
        }