public void SendMessageAsync_CallsInvoker() { HttpResponseMessage response = new HttpResponseMessage(); HttpMessageInvoker invoker = new HttpMessageInvoker(new MockHttpServer((request) => { return(response); })); var result = ODataBatchRequestItem.SendMessageAsync(invoker, new HttpRequestMessage(HttpMethod.Get, "http://example.com"), CancellationToken.None, new Dictionary <string, string>()).Result; Assert.Same(response, result); }
public void SendMessageAsync_Throws_WhenRequestIsNull() { Assert.ThrowsArgumentNull( () => ODataBatchRequestItem.SendMessageAsync(new HttpMessageInvoker(new HttpServer()), null, CancellationToken.None, null).Wait(), "request"); }
public async Task SendMessageAsync_Throws_WhenRequestIsNull() { await ExceptionAssert.ThrowsArgumentNullAsync( () => ODataBatchRequestItem.SendMessageAsync(new HttpMessageInvoker(new HttpServer()), null, CancellationToken.None, null), "request"); }
public void SendMessageAsync_Throws_WhenInvokerIsNull() { Assert.ThrowsArgumentNull( () => ODataBatchRequestItem.SendMessageAsync(null, new HttpRequestMessage(), CancellationToken.None, null).Wait(), "invoker"); }
public async Task SendMessageAsync_Throws_WhenInvokerIsNull() { await ExceptionAssert.ThrowsArgumentNullAsync( () => ODataBatchRequestItem.SendMessageAsync(null, new HttpRequestMessage(), CancellationToken.None, null), "invoker"); }