コード例 #1
0
        public void DeserializeRequest_Null_Parameters_Throws()
        {
            Message wcfMessage = new HttpRequestMessage().ToMessage();
            IDispatchMessageFormatter formatter = new SHttpMessageFormatter();

            ExceptionAssert.ThrowsArgumentNull("parameters", () => formatter.DeserializeRequest(wcfMessage, parameters: null));
        }
コード例 #2
0
        public void DeserializeRequest_Null_Message_Throws()
        {
            object[] parameters = new object[] { "hello", 5.0 };
            IDispatchMessageFormatter formatter = new SHttpMessageFormatter();

            ExceptionAssert.ThrowsArgumentNull("message", () => formatter.DeserializeRequest(/*message*/ null, parameters));
        }
コード例 #3
0
        public void DeserializeRequest_Null_HttpRequestMessage_Throws()
        {
            Message wcfMessage = Message.CreateMessage(MessageVersion.None, "unused");

            object[] parameters = new object[] { "hello", 5.0 };
            IDispatchMessageFormatter formatter = new SHttpMessageFormatter();

            ExceptionAssert.Throws <InvalidOperationException>(
                SR.HttpMessageFormatterNullMessage(typeof(SHttpMessageFormatter).Name, typeof(HttpRequestMessage).Name, "DeserializeRequest"),
                () => formatter.DeserializeRequest(wcfMessage, parameters));
        }