Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[System.Web.Services] Test DiscoveryClientProtocol
Covers #36116
- Loading branch information
Showing
2 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
...ass/System.Web.Services/Test/System.Web.Services.Discovery/DiscoveryClientProtocolTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// | ||
// MonoTests.System.Web.Services.Discovery.DiscoveryClientProtocolTest.cs | ||
// | ||
// Author: | ||
// Marcos Henrich (marcos.henrich@xamarin.com) | ||
// | ||
// Copyright (C) Xamarin Inc. 2016 | ||
// | ||
|
||
using NUnit.Framework; | ||
using System; | ||
using System.IO; | ||
using System.Web.Services.Discovery; | ||
|
||
namespace MonoTests.System.Web.Services.Discovery { | ||
|
||
[TestFixture] | ||
public class DiscoveryClientProtocolTest { | ||
|
||
[Test] // Covers #36116 | ||
[Category ("InetAccess")] | ||
public void ReadWriteTest () | ||
{ | ||
string directory = Path.Combine (Path.GetTempPath (), Path.GetRandomFileName ()); | ||
Directory.CreateDirectory (directory); | ||
try { | ||
string url = "http://www.w3schools.com/WebServices/TempConvert.asmx"; | ||
var p1 = new DiscoveryClientProtocol (); | ||
p1.DiscoverAny (url); | ||
p1.ResolveAll (); | ||
|
||
p1.WriteAll (directory, "Reference.map"); | ||
|
||
var p2 = new DiscoveryClientProtocol (); | ||
var results = p2.ReadAll (Path.Combine (directory, "Reference.map")); | ||
|
||
Assert.AreEqual (2, results.Count); | ||
Assert.AreEqual ("TempConvert.disco", results [0].Filename); | ||
Assert.AreEqual ("TempConvert.wsdl", results [1].Filename); | ||
} finally { | ||
Directory.Delete (directory, true); | ||
} | ||
} | ||
} | ||
} |