Ejemplo n.º 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));
        }
Ejemplo n.º 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));
        }
Ejemplo n.º 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));
        }