Imported Upstream version 5.14.0.78

Former-commit-id: 3494343bcc9ddb42b36b82dd9ae7b69e85e0229f
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-05-10 08:37:03 +00:00
parent 74b74abd9f
commit 19234507ba
1776 changed files with 67755 additions and 31107 deletions

View File

@@ -1055,5 +1055,47 @@ namespace MonoTests.System.Web {
}
}
// This test ensures the HttpRequest object's InputStream property
// gets properly constructed and populated when the request is not
// preloaded.
[TestFixture]
public class Test_NonPreloadedRequest
{
private const string expected = "Hello, World!\n";
class FakeHttpWorkerRequest : BaseFakeHttpWorkerRequest
{
private readonly Stream body = new MemoryStream(Encoding.UTF8.GetBytes(expected));
public override string GetHttpVerbName()
{
return "POST";
}
public override int ReadEntityBody(byte[] buffer, int size)
{
return body.Read(buffer, 0, size);
}
}
HttpContext context = null;
[SetUp]
[Category ("NotDotNet")] // Cannot be runned on .net with no web context
public void SetUp()
{
HttpWorkerRequest workerRequest = new FakeHttpWorkerRequest();
context = new HttpContext(workerRequest);
}
[Test]
[Category ("NotDotNet")] // Cannot be runned on .net with no web context
public void InputStream_Contents()
{
Assert.AreEqual(expected, new StreamReader(context.Request.InputStream, Encoding.UTF8).ReadToEnd());
}
}
}

View File

@@ -12,7 +12,8 @@ STANDALONE_RUNNER_SOURCES = \
STANDALONE_RUNNER_REFERENCES = \
-r:$(STANDALONE_RUNNER_SUPPORT_ASSEMBLY) \
-r:$(CLASSLIB_DIR)/System.Web.dll \
-r:$(CLASSLIB_DIR)/System.dll
-r:$(CLASSLIB_DIR)/System.dll \
-r:$(CLASSLIB_DIR)/mscorlib.dll
CACHE_PQ_TEST_GENERATOR_SOURCES = \
CachePQTestGenerator/CacheItemComparer.cs \