mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-04 19:26:51 +00:00
Add test for stream body
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
@@ -58,6 +59,23 @@ namespace Octokit.Tests.Http
|
||||
Assert.Equal("text/plain", requestMessage.Content.Headers.ContentType.MediaType);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SetsStreamBodyAndContentType()
|
||||
{
|
||||
var request = new Request
|
||||
{
|
||||
Method = HttpMethod.Post,
|
||||
Body = new MemoryStream(),
|
||||
ContentType = "text/plain"
|
||||
};
|
||||
var tester = new HttpClientAdapterTester();
|
||||
|
||||
var requestMessage = tester.BuildRequestMessageTester(request);
|
||||
|
||||
Assert.NotNull(requestMessage.Content);
|
||||
Assert.IsType<StreamContent>(requestMessage.Content);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SetsHttpContentBody()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user