Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tag: mono-2.10.11
Fetching contributors…

Cannot retrieve contributors at this time

file 295 lines (247 sloc) 8.328 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295
//
// Testcases.cs
//
// Author:
// Martin Baulig <martin.baulig@xamarin.com>
//
// Copyright (c) 2012 Xamarin Inc. (http://www.xamarin.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

using System;
using System.Net;
using System.Xml;
using System.Text;
using System.Collections.Generic;
using System.ServiceModel;
using System.ServiceModel.Channels;
using System.ServiceModel.Description;
using NUnit.Framework;
using NUnit.Framework.Constraints;
using NUnit.Framework.SyntaxHelpers;

using WS = System.Web.Services.Description;

namespace MonoTests.System.ServiceModel.MetadataTests {

/*
* This class is abstract to allow it to be run multiple times with
* different TestContexts.
*/
[Category ("MetadataTests")]
public abstract class ImportTests {

public abstract TestContext Context {
get;
}

protected MetadataSet GetMetadata (string name, out TestLabel label)
{
label = new TestLabel (name);
return Context.GetMetadata (name);
}

[Test]
public virtual void BasicHttp ()
{
TestLabel label;
var doc = GetMetadata ("BasicHttp", out label);

BindingTestAssertions.BasicHttpBinding (
Context, doc, BasicHttpSecurityMode.None, label);
}
[Test]
public virtual void BasicHttp_TransportSecurity ()
{
TestLabel label;
var doc = GetMetadata ("BasicHttp_TransportSecurity", out label);

BindingTestAssertions.BasicHttpBinding (
Context, doc, BasicHttpSecurityMode.Transport, label);
}
[Test]
[Category ("NotWorking")]
public virtual void BasicHttp_MessageSecurity ()
{
TestLabel label;
var doc = GetMetadata ("BasicHttp_MessageSecurity", out label);

BindingTestAssertions.BasicHttpBinding (
Context, doc, BasicHttpSecurityMode.Message, label);
}
[Test]
[Category ("NotWorking")]
public virtual void BasicHttp_TransportWithMessageCredential ()
{
TestLabel label;
var doc = GetMetadata ("BasicHttp_TransportWithMessageCredential", out label);

BindingTestAssertions.BasicHttpBinding (
Context, doc, BasicHttpSecurityMode.TransportWithMessageCredential, label);
}
[Test]
public virtual void BasicHttp_Mtom ()
{
TestLabel label;
var doc = GetMetadata ("BasicHttp_Mtom", out label);

BindingTestAssertions.BasicHttpBinding (
Context, doc, WSMessageEncoding.Mtom, label);
}

[Test]
public virtual void BasicHttp_NtlmAuth ()
{
TestLabel label;
var doc = GetMetadata ("BasicHttp_NtlmAuth", out label);

BindingTestAssertions.BasicHttpBinding (
Context, doc, BasicHttpSecurityMode.TransportCredentialOnly,
WSMessageEncoding.Text, HttpClientCredentialType.Ntlm,
AuthenticationSchemes.Ntlm, label);
}

#if NET_4_5
[Test]
public virtual void BasicHttps ()
{
TestLabel label;
var doc = GetMetadata ("BasicHttps", out label);

BindingTestAssertions.BasicHttpsBinding (
Context, doc, BasicHttpSecurityMode.Transport, WSMessageEncoding.Text,
HttpClientCredentialType.None, AuthenticationSchemes.Anonymous,
label);
}
[Test]
public virtual void BasicHttps_NtlmAuth ()
{
TestLabel label;
var doc = GetMetadata ("BasicHttps_NtlmAuth", out label);

BindingTestAssertions.BasicHttpsBinding (
Context, doc, BasicHttpSecurityMode.Transport, WSMessageEncoding.Text,
HttpClientCredentialType.Ntlm, AuthenticationSchemes.Ntlm,
label);
}
[Test]
[Category ("NotWorking")]
public virtual void BasicHttps_Certificate ()
{
TestLabel label;
var doc = GetMetadata ("BasicHttps_Certificate", out label);

BindingTestAssertions.BasicHttpsBinding (
Context, doc, BasicHttpSecurityMode.Transport, WSMessageEncoding.Text,
HttpClientCredentialType.Certificate, AuthenticationSchemes.Anonymous,
label);
}
[Test]
[Category ("NotWorking")]
public virtual void BasicHttps_TransportWithMessageCredential ()
{
TestLabel label;
var doc = GetMetadata ("BasicHttps_TransportWithMessageCredential", out label);

BindingTestAssertions.BasicHttpsBinding (
Context, doc, BasicHttpSecurityMode.TransportWithMessageCredential,
WSMessageEncoding.Text, HttpClientCredentialType.None,
AuthenticationSchemes.Anonymous, label);
}
#endif
[Test]
public virtual void NetTcp ()
{
TestLabel label;
var doc = GetMetadata ("NetTcp", out label);

BindingTestAssertions.NetTcpBinding (
Context, doc, SecurityMode.None, false, TransferMode.Buffered, label);
}

[Test]
public virtual void NetTcp_TransferMode ()
{
TestLabel label;
var doc = GetMetadata ("NetTcp_TransferMode", out label);

BindingTestAssertions.NetTcpBinding (
Context, doc, SecurityMode.None, false,
TransferMode.Streamed, label);
}

[Test]
public virtual void NetTcp_TransportSecurity ()
{
TestLabel label;
var doc = GetMetadata ("NetTcp_TransportSecurity", out label);

BindingTestAssertions.NetTcpBinding (
Context, doc, SecurityMode.Transport, false,
TransferMode.Buffered, label);
}
[Test]
[Category ("NotWorking")]
public virtual void NetTcp_MessageSecurity ()
{
TestLabel label;
var doc = GetMetadata ("NetTcp_MessageSecurity", out label);

BindingTestAssertions.NetTcpBinding (
Context, doc, SecurityMode.Message, false,
TransferMode.Buffered, label);
}
[Test]
[Category ("NotWorking")]
public virtual void NetTcp_TransportWithMessageCredential ()
{
TestLabel label;
var doc = GetMetadata ("NetTcp_TransportWithMessageCredential", out label);

BindingTestAssertions.NetTcpBinding (
Context, doc, SecurityMode.TransportWithMessageCredential, false,
TransferMode.Buffered, label);
}

[Test]
public virtual void NetTcp_Binding ()
{
var label = new TestLabel ("NetTcp_Binding");

label.EnterScope ("None");
BindingTestAssertions.CheckNetTcpBinding (
new NetTcpBinding (SecurityMode.None), SecurityMode.None,
false, TransferMode.Buffered, label);
label.LeaveScope ();

label.EnterScope ("Transport");
BindingTestAssertions.CheckNetTcpBinding (
new NetTcpBinding (SecurityMode.Transport), SecurityMode.Transport,
false, TransferMode.Buffered, label);
label.LeaveScope ();
}

[Test]
[Category ("NotWorking")]
public virtual void NetTcp_Binding2 ()
{
var label = new TestLabel ("NetTcp_Binding2");

label.EnterScope ("TransportWithMessageCredential");
BindingTestAssertions.CheckNetTcpBinding (
new NetTcpBinding (SecurityMode.TransportWithMessageCredential),
SecurityMode.TransportWithMessageCredential, false,
TransferMode.Buffered, label);
label.LeaveScope ();
}
[Test]
[Category ("NotWorking")]
public virtual void NetTcp_ReliableSession ()
{
TestLabel label;
var doc = GetMetadata ("NetTcp_ReliableSession", out label);

BindingTestAssertions.NetTcpBinding (
Context, doc, SecurityMode.None, true,
TransferMode.Buffered, label);
}

[Test]
public virtual void BasicHttp_Operation ()
{
TestLabel label;
var doc = GetMetadata ("BasicHttp_Operation", out label);

BindingTestAssertions.TestOperation (doc, false, label);
}

[Test]
public virtual void NetTcp_Operation ()
{
TestLabel label;
var doc = GetMetadata ("NetTcp_Operation", out label);

BindingTestAssertions.TestOperation (doc, true, label);
}
}

}
Something went wrong with that request. Please try again.