summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.Test
diff options
context:
space:
mode:
Diffstat (limited to 'src/DotNetOpenAuth.Test')
-rw-r--r--src/DotNetOpenAuth.Test/AssemblyTesting.cs26
-rw-r--r--src/DotNetOpenAuth.Test/CoordinatorBase.cs1
-rw-r--r--src/DotNetOpenAuth.Test/DotNetOpenAuth.Test.csproj1
-rw-r--r--src/DotNetOpenAuth.Test/Messaging/CollectionAssert.cs1
-rw-r--r--src/DotNetOpenAuth.Test/Messaging/MultipartPostPartTests.cs4
-rw-r--r--src/DotNetOpenAuth.Test/Mocks/CoordinatingChannel.cs1
-rw-r--r--src/DotNetOpenAuth.Test/Mocks/CoordinatingHttpRequestInfo.cs8
-rw-r--r--src/DotNetOpenAuth.Test/Mocks/CoordinatingOAuthConsumerChannel.cs1
-rw-r--r--src/DotNetOpenAuth.Test/Mocks/CoordinatingOAuthServiceProviderChannel.cs1
-rw-r--r--src/DotNetOpenAuth.Test/Mocks/CoordinatingOutgoingWebResponse.cs1
-rw-r--r--src/DotNetOpenAuth.Test/Mocks/MockHttpRequest.cs1
-rw-r--r--src/DotNetOpenAuth.Test/Mocks/MockIdentifier.cs1
-rw-r--r--src/DotNetOpenAuth.Test/Mocks/MockRealm.cs1
-rw-r--r--src/DotNetOpenAuth.Test/Mocks/TestMessageFactory.cs1
-rw-r--r--src/DotNetOpenAuth.Test/OAuth/ChannelElements/OAuthChannelTests.cs1
-rw-r--r--src/DotNetOpenAuth.Test/OAuth/ChannelElements/SigningBindingElementBaseTests.cs5
-rw-r--r--src/DotNetOpenAuth.Test/OAuth/OAuthCoordinator.cs1
-rw-r--r--src/DotNetOpenAuth.Test/OpenId/AuthenticationTests.cs1
-rw-r--r--src/DotNetOpenAuth.Test/OpenId/ChannelElements/ExtensionsBindingElementTests.cs1
-rw-r--r--src/DotNetOpenAuth.Test/OpenId/Extensions/ExtensionTestUtilities.cs1
-rw-r--r--src/DotNetOpenAuth.Test/OpenId/OpenIdCoordinator.cs1
-rw-r--r--src/DotNetOpenAuth.Test/Properties/AssemblyInfo.cs3
22 files changed, 9 insertions, 54 deletions
diff --git a/src/DotNetOpenAuth.Test/AssemblyTesting.cs b/src/DotNetOpenAuth.Test/AssemblyTesting.cs
deleted file mode 100644
index dac5bea..0000000
--- a/src/DotNetOpenAuth.Test/AssemblyTesting.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//-----------------------------------------------------------------------
-// <copyright file="AssemblyTesting.cs" company="Outercurve Foundation">
-// Copyright (c) Outercurve Foundation. All rights reserved.
-// </copyright>
-//-----------------------------------------------------------------------
-
-namespace DotNetOpenAuth.Test {
- using System.Diagnostics.Contracts;
- using NUnit.Framework;
-
- [SetUpFixture]
- public class AssemblyTesting {
- [SetUp]
- public static void AssemblyInitialize() {
- // Make contract failures become test failures.
- Contract.ContractFailed += (sender, e) => {
- // For now, we have tests that verify that preconditions throw exceptions.
- // So we don't want to fail a test just because a precondition check failed.
- if (e.FailureKind != ContractFailureKind.Precondition) {
- e.SetHandled();
- Assert.Fail(e.FailureKind.ToString() + ": " + e.Message);
- }
- };
- }
- }
-}
diff --git a/src/DotNetOpenAuth.Test/CoordinatorBase.cs b/src/DotNetOpenAuth.Test/CoordinatorBase.cs
index 5747e4d..d1c6f85 100644
--- a/src/DotNetOpenAuth.Test/CoordinatorBase.cs
+++ b/src/DotNetOpenAuth.Test/CoordinatorBase.cs
@@ -6,7 +6,6 @@
namespace DotNetOpenAuth.Test {
using System;
- using System.Diagnostics.Contracts;
using System.Threading;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.OpenId.RelyingParty;
diff --git a/src/DotNetOpenAuth.Test/DotNetOpenAuth.Test.csproj b/src/DotNetOpenAuth.Test/DotNetOpenAuth.Test.csproj
index 968bc8b..1ecfa30 100644
--- a/src/DotNetOpenAuth.Test/DotNetOpenAuth.Test.csproj
+++ b/src/DotNetOpenAuth.Test/DotNetOpenAuth.Test.csproj
@@ -97,7 +97,6 @@
</Reference>
</ItemGroup>
<ItemGroup>
- <Compile Include="AssemblyTesting.cs" />
<Compile Include="Configuration\SectionTests.cs" />
<Compile Include="CoordinatorBase.cs" />
<Compile Include="Hosting\AspNetHost.cs" />
diff --git a/src/DotNetOpenAuth.Test/Messaging/CollectionAssert.cs b/src/DotNetOpenAuth.Test/Messaging/CollectionAssert.cs
index 7c5a6fc..40dcc09 100644
--- a/src/DotNetOpenAuth.Test/Messaging/CollectionAssert.cs
+++ b/src/DotNetOpenAuth.Test/Messaging/CollectionAssert.cs
@@ -8,7 +8,6 @@ namespace DotNetOpenAuth.Test.Messaging {
using System;
using System.Collections;
using System.Collections.Generic;
- using System.Diagnostics.Contracts;
using System.Linq;
using DotNetOpenAuth.Messaging;
using NUnit.Framework;
diff --git a/src/DotNetOpenAuth.Test/Messaging/MultipartPostPartTests.cs b/src/DotNetOpenAuth.Test/Messaging/MultipartPostPartTests.cs
index 39267ca..e9ac5aa 100644
--- a/src/DotNetOpenAuth.Test/Messaging/MultipartPostPartTests.cs
+++ b/src/DotNetOpenAuth.Test/Messaging/MultipartPostPartTests.cs
@@ -7,11 +7,11 @@
namespace DotNetOpenAuth.Test.Messaging {
using System.CodeDom.Compiler;
using System.Collections.Generic;
- using System.Diagnostics.Contracts;
using System.IO;
using System.Net;
using DotNetOpenAuth.Messaging;
using NUnit.Framework;
+ using Validation;
[TestFixture]
public class MultipartPostPartTests : TestBase {
@@ -77,7 +77,7 @@ namespace DotNetOpenAuth.Test.Messaging {
}
private static void VerifyLength(MultipartPostPart part) {
- Contract.Requires(part != null);
+ Requires.NotNull(part, "part");
var expectedLength = part.Length;
var ms = new MemoryStream();
diff --git a/src/DotNetOpenAuth.Test/Mocks/CoordinatingChannel.cs b/src/DotNetOpenAuth.Test/Mocks/CoordinatingChannel.cs
index 1465379..475f4b5 100644
--- a/src/DotNetOpenAuth.Test/Mocks/CoordinatingChannel.cs
+++ b/src/DotNetOpenAuth.Test/Mocks/CoordinatingChannel.cs
@@ -7,7 +7,6 @@
namespace DotNetOpenAuth.Test.Mocks {
using System;
using System.Collections.Generic;
- using System.Diagnostics.Contracts;
using System.Linq;
using System.Net;
using System.Text;
diff --git a/src/DotNetOpenAuth.Test/Mocks/CoordinatingHttpRequestInfo.cs b/src/DotNetOpenAuth.Test/Mocks/CoordinatingHttpRequestInfo.cs
index 2713765..497503c 100644
--- a/src/DotNetOpenAuth.Test/Mocks/CoordinatingHttpRequestInfo.cs
+++ b/src/DotNetOpenAuth.Test/Mocks/CoordinatingHttpRequestInfo.cs
@@ -7,11 +7,11 @@
namespace DotNetOpenAuth.Test.Mocks {
using System;
using System.Collections.Generic;
- using System.Diagnostics.Contracts;
using System.Net;
using System.Web;
using DotNetOpenAuth.Messaging;
+ using Validation;
internal class CoordinatingHttpRequestInfo : HttpRequestInfo {
private readonly Channel channel;
@@ -40,9 +40,9 @@ namespace DotNetOpenAuth.Test.Mocks {
MessageReceivingEndpoint recipient,
HttpCookieCollection cookies)
: this(recipient, cookies) {
- Contract.Requires(channel != null);
- Contract.Requires(messageFactory != null);
- Contract.Requires(messageData != null);
+ Requires.NotNull(channel, "channel");
+ Requires.NotNull(messageFactory, "messageFactory");
+ Requires.NotNull(messageData, "messageData");
this.channel = channel;
this.messageData = messageData;
this.messageFactory = messageFactory;
diff --git a/src/DotNetOpenAuth.Test/Mocks/CoordinatingOAuthConsumerChannel.cs b/src/DotNetOpenAuth.Test/Mocks/CoordinatingOAuthConsumerChannel.cs
index 359fbe9..9b552d3 100644
--- a/src/DotNetOpenAuth.Test/Mocks/CoordinatingOAuthConsumerChannel.cs
+++ b/src/DotNetOpenAuth.Test/Mocks/CoordinatingOAuthConsumerChannel.cs
@@ -6,7 +6,6 @@
namespace DotNetOpenAuth.Test.Mocks {
using System;
- using System.Diagnostics.Contracts;
using System.Threading;
using System.Web;
diff --git a/src/DotNetOpenAuth.Test/Mocks/CoordinatingOAuthServiceProviderChannel.cs b/src/DotNetOpenAuth.Test/Mocks/CoordinatingOAuthServiceProviderChannel.cs
index df0b1b3..a6f2a7f 100644
--- a/src/DotNetOpenAuth.Test/Mocks/CoordinatingOAuthServiceProviderChannel.cs
+++ b/src/DotNetOpenAuth.Test/Mocks/CoordinatingOAuthServiceProviderChannel.cs
@@ -6,7 +6,6 @@
namespace DotNetOpenAuth.Test.Mocks {
using System;
- using System.Diagnostics.Contracts;
using System.Threading;
using System.Web;
diff --git a/src/DotNetOpenAuth.Test/Mocks/CoordinatingOutgoingWebResponse.cs b/src/DotNetOpenAuth.Test/Mocks/CoordinatingOutgoingWebResponse.cs
index c81e48f..9df791c 100644
--- a/src/DotNetOpenAuth.Test/Mocks/CoordinatingOutgoingWebResponse.cs
+++ b/src/DotNetOpenAuth.Test/Mocks/CoordinatingOutgoingWebResponse.cs
@@ -8,7 +8,6 @@ namespace DotNetOpenAuth.Test.Mocks {
using System;
using System.Collections.Generic;
using System.ComponentModel;
- using System.Diagnostics.Contracts;
using System.Linq;
using System.Text;
using DotNetOpenAuth.Messaging;
diff --git a/src/DotNetOpenAuth.Test/Mocks/MockHttpRequest.cs b/src/DotNetOpenAuth.Test/Mocks/MockHttpRequest.cs
index e745e0e..d20671e 100644
--- a/src/DotNetOpenAuth.Test/Mocks/MockHttpRequest.cs
+++ b/src/DotNetOpenAuth.Test/Mocks/MockHttpRequest.cs
@@ -7,7 +7,6 @@
namespace DotNetOpenAuth.Test.Mocks {
using System;
using System.Collections.Generic;
- using System.Diagnostics.Contracts;
using System.Globalization;
using System.IO;
using System.Net;
diff --git a/src/DotNetOpenAuth.Test/Mocks/MockIdentifier.cs b/src/DotNetOpenAuth.Test/Mocks/MockIdentifier.cs
index 27aa9df..f020923 100644
--- a/src/DotNetOpenAuth.Test/Mocks/MockIdentifier.cs
+++ b/src/DotNetOpenAuth.Test/Mocks/MockIdentifier.cs
@@ -7,7 +7,6 @@
namespace DotNetOpenAuth.Test.Mocks {
using System;
using System.Collections.Generic;
- using System.Diagnostics.Contracts;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.OpenId;
using DotNetOpenAuth.OpenId.RelyingParty;
diff --git a/src/DotNetOpenAuth.Test/Mocks/MockRealm.cs b/src/DotNetOpenAuth.Test/Mocks/MockRealm.cs
index 4e86251..8509c03 100644
--- a/src/DotNetOpenAuth.Test/Mocks/MockRealm.cs
+++ b/src/DotNetOpenAuth.Test/Mocks/MockRealm.cs
@@ -7,7 +7,6 @@
namespace DotNetOpenAuth.Test.Mocks {
using System;
using System.Collections.Generic;
- using System.Diagnostics.Contracts;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.OpenId;
using Validation;
diff --git a/src/DotNetOpenAuth.Test/Mocks/TestMessageFactory.cs b/src/DotNetOpenAuth.Test/Mocks/TestMessageFactory.cs
index 0ec4f46..5a47ab4 100644
--- a/src/DotNetOpenAuth.Test/Mocks/TestMessageFactory.cs
+++ b/src/DotNetOpenAuth.Test/Mocks/TestMessageFactory.cs
@@ -7,7 +7,6 @@
namespace DotNetOpenAuth.Test.Mocks {
using System;
using System.Collections.Generic;
- using System.Diagnostics.Contracts;
using System.Linq;
using System.Text;
using DotNetOpenAuth.Messaging;
diff --git a/src/DotNetOpenAuth.Test/OAuth/ChannelElements/OAuthChannelTests.cs b/src/DotNetOpenAuth.Test/OAuth/ChannelElements/OAuthChannelTests.cs
index 219ca40..b081038 100644
--- a/src/DotNetOpenAuth.Test/OAuth/ChannelElements/OAuthChannelTests.cs
+++ b/src/DotNetOpenAuth.Test/OAuth/ChannelElements/OAuthChannelTests.cs
@@ -8,7 +8,6 @@ namespace DotNetOpenAuth.Test.OAuth.ChannelElements {
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
- using System.Diagnostics.Contracts;
using System.IO;
using System.Net;
using System.Text;
diff --git a/src/DotNetOpenAuth.Test/OAuth/ChannelElements/SigningBindingElementBaseTests.cs b/src/DotNetOpenAuth.Test/OAuth/ChannelElements/SigningBindingElementBaseTests.cs
index dffe6c1..490399c 100644
--- a/src/DotNetOpenAuth.Test/OAuth/ChannelElements/SigningBindingElementBaseTests.cs
+++ b/src/DotNetOpenAuth.Test/OAuth/ChannelElements/SigningBindingElementBaseTests.cs
@@ -6,13 +6,13 @@
namespace DotNetOpenAuth.Test.OAuth.ChannelElements {
using System.Collections.Generic;
- using System.Diagnostics.Contracts;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.Messaging.Reflection;
using DotNetOpenAuth.OAuth;
using DotNetOpenAuth.OAuth.ChannelElements;
using DotNetOpenAuth.OAuth.Messages;
using NUnit.Framework;
+ using Validation;
[TestFixture]
public class SigningBindingElementBaseTests : MessagingTestBase {
@@ -125,7 +125,8 @@ namespace DotNetOpenAuth.Test.OAuth.ChannelElements {
}
internal AccessProtectedResourceRequest CreateResourceRequest(MessageReceivingEndpoint endpoint) {
- Contract.Requires(endpoint != null);
+ Requires.NotNull(endpoint, "endpoint");
+
var message = new AccessProtectedResourceRequest(endpoint, Protocol.V10.Version);
return message;
}
diff --git a/src/DotNetOpenAuth.Test/OAuth/OAuthCoordinator.cs b/src/DotNetOpenAuth.Test/OAuth/OAuthCoordinator.cs
index 10266ff..21c1775 100644
--- a/src/DotNetOpenAuth.Test/OAuth/OAuthCoordinator.cs
+++ b/src/DotNetOpenAuth.Test/OAuth/OAuthCoordinator.cs
@@ -6,7 +6,6 @@
namespace DotNetOpenAuth.Test.OAuth {
using System;
- using System.Diagnostics.Contracts;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.Messaging.Bindings;
using DotNetOpenAuth.OAuth;
diff --git a/src/DotNetOpenAuth.Test/OpenId/AuthenticationTests.cs b/src/DotNetOpenAuth.Test/OpenId/AuthenticationTests.cs
index b00b13b..14bcaec 100644
--- a/src/DotNetOpenAuth.Test/OpenId/AuthenticationTests.cs
+++ b/src/DotNetOpenAuth.Test/OpenId/AuthenticationTests.cs
@@ -6,7 +6,6 @@
namespace DotNetOpenAuth.Test.OpenId {
using System;
- using System.Diagnostics.Contracts;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.Messaging.Bindings;
using DotNetOpenAuth.OpenId;
diff --git a/src/DotNetOpenAuth.Test/OpenId/ChannelElements/ExtensionsBindingElementTests.cs b/src/DotNetOpenAuth.Test/OpenId/ChannelElements/ExtensionsBindingElementTests.cs
index 52a1c95..dd47782 100644
--- a/src/DotNetOpenAuth.Test/OpenId/ChannelElements/ExtensionsBindingElementTests.cs
+++ b/src/DotNetOpenAuth.Test/OpenId/ChannelElements/ExtensionsBindingElementTests.cs
@@ -7,7 +7,6 @@
namespace DotNetOpenAuth.Test.OpenId.ChannelElements {
using System;
using System.Collections.Generic;
- using System.Diagnostics.Contracts;
using System.Linq;
using System.Text.RegularExpressions;
using DotNetOpenAuth.Messaging;
diff --git a/src/DotNetOpenAuth.Test/OpenId/Extensions/ExtensionTestUtilities.cs b/src/DotNetOpenAuth.Test/OpenId/Extensions/ExtensionTestUtilities.cs
index 643bbae..8d0e6ff 100644
--- a/src/DotNetOpenAuth.Test/OpenId/Extensions/ExtensionTestUtilities.cs
+++ b/src/DotNetOpenAuth.Test/OpenId/Extensions/ExtensionTestUtilities.cs
@@ -7,7 +7,6 @@
namespace DotNetOpenAuth.Test.OpenId.Extensions {
using System;
using System.Collections.Generic;
- using System.Diagnostics.Contracts;
using System.Linq;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.Messaging.Bindings;
diff --git a/src/DotNetOpenAuth.Test/OpenId/OpenIdCoordinator.cs b/src/DotNetOpenAuth.Test/OpenId/OpenIdCoordinator.cs
index 0017b42..5000833 100644
--- a/src/DotNetOpenAuth.Test/OpenId/OpenIdCoordinator.cs
+++ b/src/DotNetOpenAuth.Test/OpenId/OpenIdCoordinator.cs
@@ -6,7 +6,6 @@
namespace DotNetOpenAuth.Test.OpenId {
using System;
- using System.Diagnostics.Contracts;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.Messaging.Bindings;
using DotNetOpenAuth.OpenId;
diff --git a/src/DotNetOpenAuth.Test/Properties/AssemblyInfo.cs b/src/DotNetOpenAuth.Test/Properties/AssemblyInfo.cs
index 2960d75..723aabf 100644
--- a/src/DotNetOpenAuth.Test/Properties/AssemblyInfo.cs
+++ b/src/DotNetOpenAuth.Test/Properties/AssemblyInfo.cs
@@ -4,7 +4,6 @@
// </copyright>
//-----------------------------------------------------------------------
-using System.Diagnostics.Contracts;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
@@ -21,5 +20,3 @@ using System.Runtime.InteropServices;
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("aef0bb13-b79c-4854-a69a-de58b8feb5d1")]
-
-[assembly: ContractVerification(true)] \ No newline at end of file