Imported Upstream version 5.8.0.22

Former-commit-id: df344e34b07851d296efb3e6604c8db42b6f7aa3
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2017-10-19 20:04:20 +00:00
parent 5f4a27cc8a
commit 7d05485754
5020 changed files with 114082 additions and 186061 deletions

View File

@ -7,6 +7,8 @@ using System.ServiceModel.Channels;
using System.ServiceModel.Web;
using NUnit.Framework;
using MonoTests.Helpers;
namespace MonoTests.System.ServiceModel.Activation
{
class MyHostFactory : WebScriptServiceHostFactory
@ -23,8 +25,9 @@ namespace MonoTests.System.ServiceModel.Activation
[Test]
public void CreateServiceHost ()
{
var port = NetworkHelpers.FindFreePort ();
var f = new MyHostFactory ();
var host = f.DoCreateServiceHost (typeof (TestService), new Uri [] {new Uri ("http://localhost:37564")});
var host = f.DoCreateServiceHost (typeof (TestService), new Uri [] {new Uri ($"http://localhost:{port}")});
Assert.IsFalse (host is WebServiceHost, "#1");
host.Open ();
host.Close ();
@ -34,8 +37,9 @@ namespace MonoTests.System.ServiceModel.Activation
[ExpectedException (typeof (NotSupportedException))]
public void ResponseWrappedIsInvalid ()
{
var port = NetworkHelpers.FindFreePort ();
var f = new MyHostFactory ();
var host = f.DoCreateServiceHost (typeof (TestService2), new Uri [] {new Uri ("http://localhost:37564")});
var host = f.DoCreateServiceHost (typeof (TestService2), new Uri [] {new Uri ($"http://localhost:{port}")});
host.Open (); // should raise an error here.
}
@ -43,8 +47,9 @@ namespace MonoTests.System.ServiceModel.Activation
[ExpectedException (typeof (InvalidOperationException))]
public void MultipleContract ()
{
var port = NetworkHelpers.FindFreePort ();
var f = new MyHostFactory ();
var host = f.DoCreateServiceHost (typeof (TestServiceMultiple), new Uri [] {new Uri ("http://localhost:37564")});
var host = f.DoCreateServiceHost (typeof (TestServiceMultiple), new Uri [] {new Uri ($"http://localhost:{port}")});
host.Open ();
}