diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2012-04-04 20:58:04 -0700 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2012-04-04 20:58:04 -0700 |
commit | 2fe0a3d03eac3d4a238347f023bb63fd579d1060 (patch) | |
tree | a8fb3dbae481a90349845fcaa396cb903a4249ed | |
parent | 14f6007a7d0de2d3b1bfc2eb3cd75296924aa456 (diff) | |
download | DotNetOpenAuth-2fe0a3d03eac3d4a238347f023bb63fd579d1060.zip DotNetOpenAuth-2fe0a3d03eac3d4a238347f023bb63fd579d1060.tar.gz DotNetOpenAuth-2fe0a3d03eac3d4a238347f023bb63fd579d1060.tar.bz2 |
Replaced a bunch of TestCase attribute usages with simply Test.
42 files changed, 139 insertions, 139 deletions
diff --git a/src/DotNetOpenAuth.Test/LocalizationTests.cs b/src/DotNetOpenAuth.Test/LocalizationTests.cs index af2dcb7..6c4bc14 100644 --- a/src/DotNetOpenAuth.Test/LocalizationTests.cs +++ b/src/DotNetOpenAuth.Test/LocalizationTests.cs @@ -20,7 +20,7 @@ namespace DotNetOpenAuth.Test { /// <summary> /// Tests that Serbian localized strings are correctly installed. /// </summary> - [TestCase, ExpectedException(typeof(InvalidOperationException), ExpectedMessage = "Ovaj metod zahteva tekući HttpContext. Kao alternativa, koristite preklopljeni metod koji dozvoljava da se prosledi informacija bez HttpContext-a.")] + [Test, ExpectedException(typeof(InvalidOperationException), ExpectedMessage = "Ovaj metod zahteva tekući HttpContext. Kao alternativa, koristite preklopljeni metod koji dozvoljava da se prosledi informacija bez HttpContext-a.")] public void Serbian() { HttpContext.Current = null; // our testbase initializes this, but it must be null to throw Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo("sr"); diff --git a/src/DotNetOpenAuth.Test/Messaging/Bindings/StandardExpirationBindingElementTests.cs b/src/DotNetOpenAuth.Test/Messaging/Bindings/StandardExpirationBindingElementTests.cs index acd41bc..6aa9461 100644 --- a/src/DotNetOpenAuth.Test/Messaging/Bindings/StandardExpirationBindingElementTests.cs +++ b/src/DotNetOpenAuth.Test/Messaging/Bindings/StandardExpirationBindingElementTests.cs @@ -38,13 +38,13 @@ namespace DotNetOpenAuth.Test.Messaging.Bindings { this.ParameterizedReceiveProtectedTest(DateTime.UtcNow + DotNetOpenAuthSection.Messaging.MaximumClockSkew - TimeSpan.FromSeconds(1), false); } - [TestCase, ExpectedException(typeof(ExpiredMessageException))] + [Test, ExpectedException(typeof(ExpiredMessageException))] public void VerifyOldTimestampIsRejected() { this.Channel = CreateChannel(MessageProtections.Expiration); this.ParameterizedReceiveProtectedTest(DateTime.UtcNow - StandardExpirationBindingElement.MaximumMessageAge - TimeSpan.FromSeconds(1), false); } - [TestCase, ExpectedException(typeof(ProtocolException))] + [Test, ExpectedException(typeof(ProtocolException))] public void VerifyFutureTimestampIsRejected() { this.Channel = CreateChannel(MessageProtections.Expiration); this.ParameterizedReceiveProtectedTest(DateTime.UtcNow + DotNetOpenAuthSection.Messaging.MaximumClockSkew + TimeSpan.FromSeconds(2), false); diff --git a/src/DotNetOpenAuth.Test/Messaging/Bindings/StandardReplayProtectionBindingElementTests.cs b/src/DotNetOpenAuth.Test/Messaging/Bindings/StandardReplayProtectionBindingElementTests.cs index 34c3a85..9a46e42 100644 --- a/src/DotNetOpenAuth.Test/Messaging/Bindings/StandardReplayProtectionBindingElementTests.cs +++ b/src/DotNetOpenAuth.Test/Messaging/Bindings/StandardReplayProtectionBindingElementTests.cs @@ -75,7 +75,7 @@ namespace DotNetOpenAuth.Test.Messaging.Bindings { /// <summary> /// Verifies that a message that doesn't have a string of random characters is received correctly. /// </summary> - [TestCase, ExpectedException(typeof(ProtocolException))] + [Test, ExpectedException(typeof(ProtocolException))] public void InvalidMessageNoNonceReceivedTest() { this.message.Nonce = string.Empty; this.nonceElement.AllowZeroLengthNonce = false; @@ -85,7 +85,7 @@ namespace DotNetOpenAuth.Test.Messaging.Bindings { /// <summary> /// Verifies that a replayed message is rejected. /// </summary> - [TestCase, ExpectedException(typeof(ReplayedMessageException))] + [Test, ExpectedException(typeof(ReplayedMessageException))] public void ReplayDetectionTest() { this.message.Nonce = "a"; Assert.IsNotNull(this.nonceElement.ProcessIncomingMessage(this.message)); diff --git a/src/DotNetOpenAuth.Test/Messaging/ChannelTests.cs b/src/DotNetOpenAuth.Test/Messaging/ChannelTests.cs index 425f5f3..5646a7e 100644 --- a/src/DotNetOpenAuth.Test/Messaging/ChannelTests.cs +++ b/src/DotNetOpenAuth.Test/Messaging/ChannelTests.cs @@ -17,7 +17,7 @@ namespace DotNetOpenAuth.Test.Messaging { [TestFixture] public class ChannelTests : MessagingTestBase { - [TestCase, ExpectedException(typeof(ArgumentNullException))] + [Test, ExpectedException(typeof(ArgumentNullException))] public void CtorNull() { // This bad channel is deliberately constructed to pass null to // its protected base class' constructor. @@ -38,31 +38,31 @@ namespace DotNetOpenAuth.Test.Messaging { /// Verifies compliance to OpenID 2.0 section 5.1.1 by verifying the channel /// will reject messages that come with an unexpected HTTP verb. /// </summary> - [TestCase, ExpectedException(typeof(ProtocolException))] + [Test, ExpectedException(typeof(ProtocolException))] public void ReadFromRequestDisallowedHttpMethod() { var fields = GetStandardTestFields(FieldFill.CompleteBeforeBindings); fields["GetOnly"] = "true"; this.Channel.ReadFromRequest(CreateHttpRequestInfo("POST", fields)); } - [TestCase, ExpectedException(typeof(ArgumentNullException))] + [Test, ExpectedException(typeof(ArgumentNullException))] public void SendNull() { this.Channel.PrepareResponse(null); } - [TestCase, ExpectedException(typeof(ArgumentException))] + [Test, ExpectedException(typeof(ArgumentException))] public void SendIndirectedUndirectedMessage() { IProtocolMessage message = new TestDirectedMessage(MessageTransport.Indirect); this.Channel.PrepareResponse(message); } - [TestCase, ExpectedException(typeof(ArgumentException))] + [Test, ExpectedException(typeof(ArgumentException))] public void SendDirectedNoRecipientMessage() { IProtocolMessage message = new TestDirectedMessage(MessageTransport.Indirect); this.Channel.PrepareResponse(message); } - [TestCase, ExpectedException(typeof(ArgumentException))] + [Test, ExpectedException(typeof(ArgumentException))] public void SendInvalidMessageTransport() { IProtocolMessage message = new TestDirectedMessage((MessageTransport)100); this.Channel.PrepareResponse(message); @@ -88,20 +88,20 @@ namespace DotNetOpenAuth.Test.Messaging { } } - [TestCase, ExpectedException(typeof(ArgumentNullException))] + [Test, ExpectedException(typeof(ArgumentNullException))] public void SendIndirectMessage301GetNullMessage() { TestBadChannel badChannel = new TestBadChannel(false); badChannel.Create301RedirectResponse(null, new Dictionary<string, string>()); } - [TestCase, ExpectedException(typeof(ArgumentException))] + [Test, ExpectedException(typeof(ArgumentException))] public void SendIndirectMessage301GetEmptyRecipient() { TestBadChannel badChannel = new TestBadChannel(false); var message = new TestDirectedMessage(MessageTransport.Indirect); badChannel.Create301RedirectResponse(message, new Dictionary<string, string>()); } - [TestCase, ExpectedException(typeof(ArgumentNullException))] + [Test, ExpectedException(typeof(ArgumentNullException))] public void SendIndirectMessage301GetNullFields() { TestBadChannel badChannel = new TestBadChannel(false); var message = new TestDirectedMessage(MessageTransport.Indirect); @@ -133,20 +133,20 @@ namespace DotNetOpenAuth.Test.Messaging { StringAssert.Contains(".submit()", body, "There should be some javascript to automate form submission."); } - [TestCase, ExpectedException(typeof(ArgumentNullException))] + [Test, ExpectedException(typeof(ArgumentNullException))] public void SendIndirectMessageFormPostNullMessage() { TestBadChannel badChannel = new TestBadChannel(false); badChannel.CreateFormPostResponse(null, new Dictionary<string, string>()); } - [TestCase, ExpectedException(typeof(ArgumentException))] + [Test, ExpectedException(typeof(ArgumentException))] public void SendIndirectMessageFormPostEmptyRecipient() { TestBadChannel badChannel = new TestBadChannel(false); var message = new TestDirectedMessage(MessageTransport.Indirect); badChannel.CreateFormPostResponse(message, new Dictionary<string, string>()); } - [TestCase, ExpectedException(typeof(ArgumentNullException))] + [Test, ExpectedException(typeof(ArgumentNullException))] public void SendIndirectMessageFormPostNullFields() { TestBadChannel badChannel = new TestBadChannel(false); var message = new TestDirectedMessage(MessageTransport.Indirect); @@ -161,7 +161,7 @@ namespace DotNetOpenAuth.Test.Messaging { /// Since this is a mock channel that doesn't actually formulate a direct message response, /// we just check that the right method was called. /// </remarks> - [TestCase, ExpectedException(typeof(NotImplementedException))] + [Test, ExpectedException(typeof(NotImplementedException))] public void SendDirectMessageResponse() { IProtocolMessage message = new TestDirectedMessage { Age = 15, @@ -171,13 +171,13 @@ namespace DotNetOpenAuth.Test.Messaging { this.Channel.PrepareResponse(message); } - [TestCase, ExpectedException(typeof(ArgumentNullException))] + [Test, ExpectedException(typeof(ArgumentNullException))] public void SendIndirectMessageNull() { TestBadChannel badChannel = new TestBadChannel(false); badChannel.PrepareIndirectResponse(null); } - [TestCase, ExpectedException(typeof(ArgumentNullException))] + [Test, ExpectedException(typeof(ArgumentNullException))] public void ReceiveNull() { TestBadChannel badChannel = new TestBadChannel(false); badChannel.Receive(null, null); @@ -201,14 +201,14 @@ namespace DotNetOpenAuth.Test.Messaging { Assert.AreEqual(expectedMessage.Age, ((TestMessage)message).Age); } - [TestCase, ExpectedException(typeof(InvalidOperationException))] + [Test, ExpectedException(typeof(InvalidOperationException))] public void ReadFromRequestNoContext() { HttpContext.Current = null; TestBadChannel badChannel = new TestBadChannel(false); badChannel.ReadFromRequest(); } - [TestCase, ExpectedException(typeof(ArgumentNullException))] + [Test, ExpectedException(typeof(ArgumentNullException))] public void ReadFromRequestNull() { TestBadChannel badChannel = new TestBadChannel(false); badChannel.ReadFromRequest(null); @@ -224,7 +224,7 @@ namespace DotNetOpenAuth.Test.Messaging { Assert.IsNotNull(((IReplayProtectedProtocolMessage)message).Nonce); } - [TestCase, ExpectedException(typeof(InvalidSignatureException))] + [Test, ExpectedException(typeof(InvalidSignatureException))] public void ReceivedInvalidSignature() { this.Channel = CreateChannel(MessageProtections.TamperProtection); this.ParameterizedReceiveProtectedTest(DateTime.UtcNow, true); @@ -236,21 +236,21 @@ namespace DotNetOpenAuth.Test.Messaging { this.ParameterizedReceiveProtectedTest(DateTime.UtcNow, false); } - [TestCase, ExpectedException(typeof(ReplayedMessageException))] + [Test, ExpectedException(typeof(ReplayedMessageException))] public void ReceivedReplayProtectedMessageTwice() { this.Channel = CreateChannel(MessageProtections.ReplayProtection); this.ParameterizedReceiveProtectedTest(DateTime.UtcNow, false); this.ParameterizedReceiveProtectedTest(DateTime.UtcNow, false); } - [TestCase, ExpectedException(typeof(ProtocolException))] + [Test, ExpectedException(typeof(ProtocolException))] public void MessageExpirationWithoutTamperResistance() { new TestChannel( new TestMessageFactory(), new StandardExpirationBindingElement()); } - [TestCase, ExpectedException(typeof(ProtocolException))] + [Test, ExpectedException(typeof(ProtocolException))] public void TooManyBindingElementsProvidingSameProtection() { Channel channel = new TestChannel( new TestMessageFactory(), @@ -283,20 +283,20 @@ namespace DotNetOpenAuth.Test.Messaging { Assert.AreSame(sign, channel.BindingElements[4]); } - [TestCase, ExpectedException(typeof(UnprotectedMessageException))] + [Test, ExpectedException(typeof(UnprotectedMessageException))] public void InsufficientlyProtectedMessageSent() { var message = new TestSignedDirectedMessage(MessageTransport.Direct); message.Recipient = new Uri("http://localtest"); this.Channel.PrepareResponse(message); } - [TestCase, ExpectedException(typeof(UnprotectedMessageException))] + [Test, ExpectedException(typeof(UnprotectedMessageException))] public void InsufficientlyProtectedMessageReceived() { this.Channel = CreateChannel(MessageProtections.None, MessageProtections.TamperProtection); this.ParameterizedReceiveProtectedTest(DateTime.Now, false); } - [TestCase, ExpectedException(typeof(ProtocolException))] + [Test, ExpectedException(typeof(ProtocolException))] public void IncomingMessageMissingRequiredParameters() { var fields = GetStandardTestFields(FieldFill.IdentifiableButNotAllRequired); this.Channel.ReadFromRequest(CreateHttpRequestInfo("GET", fields)); diff --git a/src/DotNetOpenAuth.Test/Messaging/EnumerableCacheTests.cs b/src/DotNetOpenAuth.Test/Messaging/EnumerableCacheTests.cs index f425563..25b7d12 100644 --- a/src/DotNetOpenAuth.Test/Messaging/EnumerableCacheTests.cs +++ b/src/DotNetOpenAuth.Test/Messaging/EnumerableCacheTests.cs @@ -98,7 +98,7 @@ namespace DotNetOpenAuth.Test.Messaging { /// <summary> /// Tests calling IEnumerator.Current before first call to MoveNext. /// </summary> - [TestCase, ExpectedException(typeof(InvalidOperationException))] + [Test, ExpectedException(typeof(InvalidOperationException))] public void EnumerableCacheCurrentThrowsBefore() { var foo = this.NumberGenerator().CacheGeneratedResults().GetEnumerator().Current; } @@ -106,7 +106,7 @@ namespace DotNetOpenAuth.Test.Messaging { /// <summary> /// Tests calling IEnumerator.Current after MoveNext returns false. /// </summary> - [TestCase, ExpectedException(typeof(InvalidOperationException))] + [Test, ExpectedException(typeof(InvalidOperationException))] public void EnumerableCacheCurrentThrowsAfter() { var enumerator = this.NumberGenerator().CacheGeneratedResults().GetEnumerator(); while (enumerator.MoveNext()) { diff --git a/src/DotNetOpenAuth.Test/Messaging/ErrorUtilitiesTests.cs b/src/DotNetOpenAuth.Test/Messaging/ErrorUtilitiesTests.cs index 10aeef1..f0ab317 100644 --- a/src/DotNetOpenAuth.Test/Messaging/ErrorUtilitiesTests.cs +++ b/src/DotNetOpenAuth.Test/Messaging/ErrorUtilitiesTests.cs @@ -11,7 +11,7 @@ namespace DotNetOpenAuth.Test.Messaging { [TestFixture] public class ErrorUtilitiesTests { - [TestCase, ExpectedException(typeof(ArgumentNullException))] + [Test, ExpectedException(typeof(ArgumentNullException))] public void VerifyArgumentNotNullThrows() { ErrorUtilities.VerifyArgumentNotNull(null, "someArg"); } @@ -21,12 +21,12 @@ namespace DotNetOpenAuth.Test.Messaging { ErrorUtilities.VerifyArgumentNotNull("hi", "someArg"); } - [TestCase, ExpectedException(typeof(ArgumentNullException))] + [Test, ExpectedException(typeof(ArgumentNullException))] public void VerifyNonZeroLengthOnNull() { ErrorUtilities.VerifyNonZeroLength(null, "someArg"); } - [TestCase, ExpectedException(typeof(ArgumentException))] + [Test, ExpectedException(typeof(ArgumentException))] public void VerifyNonZeroLengthOnEmpty() { ErrorUtilities.VerifyNonZeroLength(string.Empty, "someArg"); } diff --git a/src/DotNetOpenAuth.Test/Messaging/MessageSerializerTests.cs b/src/DotNetOpenAuth.Test/Messaging/MessageSerializerTests.cs index 3a07b45..2e69e85 100644 --- a/src/DotNetOpenAuth.Test/Messaging/MessageSerializerTests.cs +++ b/src/DotNetOpenAuth.Test/Messaging/MessageSerializerTests.cs @@ -19,23 +19,23 @@ namespace DotNetOpenAuth.Test.Messaging { /// </summary> [TestFixture] public class MessageSerializerTests : MessagingTestBase { - [TestCase, ExpectedException(typeof(ArgumentNullException))] + [Test, ExpectedException(typeof(ArgumentNullException))] public void SerializeNull() { var serializer = MessageSerializer.Get(typeof(Mocks.TestMessage)); serializer.Serialize(null); } - [TestCase, ExpectedException(typeof(ArgumentException))] + [Test, ExpectedException(typeof(ArgumentException))] public void GetInvalidMessageType() { MessageSerializer.Get(typeof(string)); } - [TestCase, ExpectedException(typeof(ArgumentNullException))] + [Test, ExpectedException(typeof(ArgumentNullException))] public void GetNullType() { MessageSerializer.Get(null); } - [TestCase] + [Test] public void SerializeTest() { var serializer = MessageSerializer.Get(typeof(Mocks.TestMessage)); var message = GetStandardTestMessage(FieldFill.CompleteBeforeBindings); @@ -83,7 +83,7 @@ namespace DotNetOpenAuth.Test.Messaging { Assert.AreEqual(message.Timestamp, deserialized.Timestamp); } - [TestCase, ExpectedException(typeof(ArgumentNullException))] + [Test, ExpectedException(typeof(ArgumentNullException))] public void DeserializeNull() { var serializer = MessageSerializer.Get(typeof(Mocks.TestMessage)); MessageSerializer.Deserialize(null, null); @@ -153,7 +153,7 @@ namespace DotNetOpenAuth.Test.Messaging { Assert.IsNull(actual.EmptyMember); } - [TestCase, ExpectedException(typeof(ProtocolException))] + [Test, ExpectedException(typeof(ProtocolException))] public void DeserializeInvalidMessage() { IProtocolMessage message = new Mocks.TestDirectedMessage(); var serializer = MessageSerializer.Get(message.GetType()); diff --git a/src/DotNetOpenAuth.Test/Messaging/MessagingUtilitiesTests.cs b/src/DotNetOpenAuth.Test/Messaging/MessagingUtilitiesTests.cs index 1f4b1d0..a767d53 100644 --- a/src/DotNetOpenAuth.Test/Messaging/MessagingUtilitiesTests.cs +++ b/src/DotNetOpenAuth.Test/Messaging/MessagingUtilitiesTests.cs @@ -32,7 +32,7 @@ namespace DotNetOpenAuth.Test.Messaging { Assert.AreEqual(0, MessagingUtilities.CreateQueryString(new Dictionary<string, string>()).Length); } - [TestCase, ExpectedException(typeof(ArgumentNullException))] + [Test, ExpectedException(typeof(ArgumentNullException))] public void CreateQueryStringNullDictionary() { MessagingUtilities.CreateQueryString(null); } @@ -51,7 +51,7 @@ namespace DotNetOpenAuth.Test.Messaging { Assert.AreEqual("http://baseline.org/page?a=b&c%2Fd=e%2Ff&g=h", uri.Uri.AbsoluteUri); } - [TestCase, ExpectedException(typeof(ArgumentNullException))] + [Test, ExpectedException(typeof(ArgumentNullException))] public void AppendQueryArgsNullUriBuilder() { MessagingUtilities.AppendQueryArgs(null, new Dictionary<string, string>()); } @@ -73,7 +73,7 @@ namespace DotNetOpenAuth.Test.Messaging { Assert.AreEqual(nvc["c"], actual["c"]); } - [TestCase, ExpectedException(typeof(ArgumentException))] + [Test, ExpectedException(typeof(ArgumentException))] public void ToDictionaryWithNullKey() { NameValueCollection nvc = new NameValueCollection(); nvc[null] = "a"; @@ -96,17 +96,17 @@ namespace DotNetOpenAuth.Test.Messaging { Assert.IsNull(MessagingUtilities.ToDictionary(null)); } - [TestCase, ExpectedException(typeof(ArgumentNullException))] + [Test, ExpectedException(typeof(ArgumentNullException))] public void ApplyHeadersToResponseNullAspNetResponse() { MessagingUtilities.ApplyHeadersToResponse(new WebHeaderCollection(), (HttpResponseBase)null); } - [TestCase, ExpectedException(typeof(ArgumentNullException))] + [Test, ExpectedException(typeof(ArgumentNullException))] public void ApplyHeadersToResponseNullListenerResponse() { MessagingUtilities.ApplyHeadersToResponse(new WebHeaderCollection(), (HttpListenerResponse)null); } - [TestCase, ExpectedException(typeof(ArgumentNullException))] + [Test, ExpectedException(typeof(ArgumentNullException))] public void ApplyHeadersToResponseNullHeaders() { MessagingUtilities.ApplyHeadersToResponse(null, new HttpResponseWrapper(new HttpResponse(new StringWriter()))); } @@ -192,7 +192,7 @@ namespace DotNetOpenAuth.Test.Messaging { /// <summary> /// Verifies proper behavior of GetHttpVerb on invalid input. /// </summary> - [TestCase, ExpectedException(typeof(ArgumentException))] + [Test, ExpectedException(typeof(ArgumentException))] public void GetHttpVerbOutOfRangeTest() { MessagingUtilities.GetHttpVerb(HttpDeliveryMethods.PutRequest | HttpDeliveryMethods.PostRequest); } @@ -212,7 +212,7 @@ namespace DotNetOpenAuth.Test.Messaging { /// <summary> /// Verifies proper behavior of GetHttpDeliveryMethod for an unexpected input /// </summary> - [TestCase, ExpectedException(typeof(ArgumentException))] + [Test, ExpectedException(typeof(ArgumentException))] public void GetHttpDeliveryMethodOutOfRangeTest() { MessagingUtilities.GetHttpDeliveryMethod("UNRECOGNIZED"); } @@ -249,7 +249,7 @@ namespace DotNetOpenAuth.Test.Messaging { /// <summary> /// Verifies that EqualsConstantTime actually has the same execution time regardless of how well a value matches. /// </summary> - [TestCase, Category("Performance")] + [Test, Category("Performance")] public void EqualsConstantTimeIsActuallyConstantTime() { string expected = new string('A', 5000); string totalmismatch = new string('B', 5000); diff --git a/src/DotNetOpenAuth.Test/Messaging/ProtocolExceptionTests.cs b/src/DotNetOpenAuth.Test/Messaging/ProtocolExceptionTests.cs index c05f8c3..4d107c8 100644 --- a/src/DotNetOpenAuth.Test/Messaging/ProtocolExceptionTests.cs +++ b/src/DotNetOpenAuth.Test/Messaging/ProtocolExceptionTests.cs @@ -37,7 +37,7 @@ namespace DotNetOpenAuth.Test.Messaging { Assert.AreSame(message, ex.FaultedMessage); } - [TestCase, ExpectedException(typeof(ArgumentNullException))] + [Test, ExpectedException(typeof(ArgumentNullException))] public void CtorWithNullProtocolMessage() { new ProtocolException("message", (IProtocolMessage)null); } diff --git a/src/DotNetOpenAuth.Test/Messaging/Reflection/MessageDescriptionTests.cs b/src/DotNetOpenAuth.Test/Messaging/Reflection/MessageDescriptionTests.cs index 66aef6c..d78456f 100644 --- a/src/DotNetOpenAuth.Test/Messaging/Reflection/MessageDescriptionTests.cs +++ b/src/DotNetOpenAuth.Test/Messaging/Reflection/MessageDescriptionTests.cs @@ -12,17 +12,17 @@ namespace DotNetOpenAuth.Test.Messaging.Reflection { [TestFixture] public class MessageDescriptionTests : MessagingTestBase { - [TestCase, ExpectedException(typeof(ArgumentNullException))] + [Test, ExpectedException(typeof(ArgumentNullException))] public void CtorNullType() { new MessageDescription(null, new Version(1, 0)); } - [TestCase, ExpectedException(typeof(ArgumentNullException))] + [Test, ExpectedException(typeof(ArgumentNullException))] public void CtorNullVersion() { new MessageDescription(typeof(Mocks.TestMessage), null); } - [TestCase, ExpectedException(typeof(ArgumentException))] + [Test, ExpectedException(typeof(ArgumentException))] public void CtorNonMessageType() { new MessageDescription(typeof(string), new Version(1, 0)); } diff --git a/src/DotNetOpenAuth.Test/Messaging/Reflection/MessageDictionaryTests.cs b/src/DotNetOpenAuth.Test/Messaging/Reflection/MessageDictionaryTests.cs index ec21e31..3be56d1 100644 --- a/src/DotNetOpenAuth.Test/Messaging/Reflection/MessageDictionaryTests.cs +++ b/src/DotNetOpenAuth.Test/Messaging/Reflection/MessageDictionaryTests.cs @@ -25,7 +25,7 @@ namespace DotNetOpenAuth.Test.Messaging.Reflection { this.message = new Mocks.TestDirectedMessage(); } - [TestCase, ExpectedException(typeof(ArgumentNullException))] + [Test, ExpectedException(typeof(ArgumentNullException))] public void CtorNull() { this.MessageDescriptions.GetAccessor(null); } @@ -234,7 +234,7 @@ namespace DotNetOpenAuth.Test.Messaging.Reflection { Assert.AreEqual("Andrew", this.message.Name); } - [TestCase, ExpectedException(typeof(ArgumentNullException))] + [Test, ExpectedException(typeof(ArgumentNullException))] public void AddNullValue() { IDictionary<string, string> target = this.MessageDescriptions.GetAccessor(this.message); target.Add("extra", null); @@ -250,14 +250,14 @@ namespace DotNetOpenAuth.Test.Messaging.Reflection { Assert.IsTrue(target.Contains(new KeyValuePair<string, string>("extra", "value"))); } - [TestCase, ExpectedException(typeof(ArgumentException))] + [Test, ExpectedException(typeof(ArgumentException))] public void AddExtraFieldThatAlreadyExists() { IDictionary<string, string> target = this.MessageDescriptions.GetAccessor(this.message); target.Add("extra", "value"); target.Add("extra", "value"); } - [TestCase, ExpectedException(typeof(ArgumentException))] + [Test, ExpectedException(typeof(ArgumentException))] public void AddDeclaredValueThatAlreadyExists() { IDictionary<string, string> target = this.MessageDescriptions.GetAccessor(this.message); target.Add("Name", "andrew"); @@ -347,7 +347,7 @@ namespace DotNetOpenAuth.Test.Messaging.Reflection { /// <summary> /// Verifies that the Clear method throws the expected exception. /// </summary> - [TestCase, ExpectedException(typeof(NotSupportedException))] + [Test, ExpectedException(typeof(NotSupportedException))] public void Clear() { MessageDictionary target = this.MessageDescriptions.GetAccessor(this.message); target.Clear(); diff --git a/src/DotNetOpenAuth.Test/Messaging/Reflection/MessagePartTests.cs b/src/DotNetOpenAuth.Test/Messaging/Reflection/MessagePartTests.cs index 1d820d4..dbcadab 100644 --- a/src/DotNetOpenAuth.Test/Messaging/Reflection/MessagePartTests.cs +++ b/src/DotNetOpenAuth.Test/Messaging/Reflection/MessagePartTests.cs @@ -16,7 +16,7 @@ namespace DotNetOpenAuth.Test.Messaging.Reflection { [TestFixture] public class MessagePartTests : MessagingTestBase { - [TestCase, ExpectedException(typeof(ArgumentException))] + [Test, ExpectedException(typeof(ArgumentException))] public void OptionalNonNullableStruct() { this.ParameterizedMessageTypeTest(typeof(MessageWithNonNullableOptionalStruct)); } @@ -41,12 +41,12 @@ namespace DotNetOpenAuth.Test.Messaging.Reflection { this.ParameterizedMessageTypeTest(typeof(MessageWithNullableRequiredStruct)); } - [TestCase, ExpectedException(typeof(ArgumentNullException))] + [Test, ExpectedException(typeof(ArgumentNullException))] public void CtorNullMember() { new MessagePart(null, new MessagePartAttribute()); } - [TestCase, ExpectedException(typeof(ArgumentNullException))] + [Test, ExpectedException(typeof(ArgumentNullException))] public void CtorNullAttribute() { PropertyInfo field = typeof(MessageWithNullableOptionalStruct).GetProperty("OptionalInt", BindingFlags.NonPublic | BindingFlags.Instance); new MessagePart(field, null); @@ -87,14 +87,14 @@ namespace DotNetOpenAuth.Test.Messaging.Reflection { Assert.AreEqual("abc", part.GetValue(message)); } - [TestCase, ExpectedException(typeof(ProtocolException))] + [Test, ExpectedException(typeof(ProtocolException))] public void ConstantFieldMemberInvalidValues() { var message = new MessageWithConstantField(); MessagePart part = GetMessagePart(message.GetType(), "ConstantField"); part.SetValue(message, "def"); } - [TestCase, ExpectedException(typeof(ArgumentException))] + [Test, ExpectedException(typeof(ArgumentException))] public void NonFieldOrPropertyMember() { MemberInfo method = typeof(MessageWithNullableOptionalStruct).GetMethod("Equals", BindingFlags.Public | BindingFlags.Instance); new MessagePart(method, new MessagePartAttribute()); diff --git a/src/DotNetOpenAuth.Test/Messaging/Reflection/ValueMappingTests.cs b/src/DotNetOpenAuth.Test/Messaging/Reflection/ValueMappingTests.cs index 8e7ebf8..cb3bd0c 100644 --- a/src/DotNetOpenAuth.Test/Messaging/Reflection/ValueMappingTests.cs +++ b/src/DotNetOpenAuth.Test/Messaging/Reflection/ValueMappingTests.cs @@ -11,12 +11,12 @@ namespace DotNetOpenAuth.Test.Messaging.Reflection { [TestFixture] public class ValueMappingTests { - [TestCase, ExpectedException(typeof(ArgumentNullException))] + [Test, ExpectedException(typeof(ArgumentNullException))] public void CtorNullToString() { new ValueMapping(null, null, str => new object()); } - [TestCase, ExpectedException(typeof(ArgumentNullException))] + [Test, ExpectedException(typeof(ArgumentNullException))] public void CtorNullToObject() { new ValueMapping(obj => obj.ToString(), null, null); } diff --git a/src/DotNetOpenAuth.Test/Messaging/ResponseTests.cs b/src/DotNetOpenAuth.Test/Messaging/ResponseTests.cs index 63e0d74..52f031e 100644 --- a/src/DotNetOpenAuth.Test/Messaging/ResponseTests.cs +++ b/src/DotNetOpenAuth.Test/Messaging/ResponseTests.cs @@ -13,7 +13,7 @@ namespace DotNetOpenAuth.Test.Messaging { [TestFixture] public class ResponseTests : TestBase { - [TestCase, ExpectedException(typeof(InvalidOperationException))] + [Test, ExpectedException(typeof(InvalidOperationException))] public void RespondWithoutAspNetContext() { HttpContext.Current = null; new OutgoingWebResponse().Respond(); diff --git a/src/DotNetOpenAuth.Test/Messaging/StandardMessageFactoryTests.cs b/src/DotNetOpenAuth.Test/Messaging/StandardMessageFactoryTests.cs index e3316f1..84ee556 100644 --- a/src/DotNetOpenAuth.Test/Messaging/StandardMessageFactoryTests.cs +++ b/src/DotNetOpenAuth.Test/Messaging/StandardMessageFactoryTests.cs @@ -30,7 +30,7 @@ namespace DotNetOpenAuth.Test.Messaging { /// <summary> /// Verifies that AddMessageTypes throws the appropriate exception on null input. /// </summary> - [TestCase, ExpectedException(typeof(ArgumentNullException))] + [Test, ExpectedException(typeof(ArgumentNullException))] public void AddMessageTypesNull() { this.factory.AddMessageTypes(null); } @@ -38,7 +38,7 @@ namespace DotNetOpenAuth.Test.Messaging { /// <summary> /// Verifies that AddMessageTypes throws the appropriate exception on null input. /// </summary> - [TestCase, ExpectedException(typeof(ArgumentException))] + [Test, ExpectedException(typeof(ArgumentException))] public void AddMessageTypesNullMessageDescription() { this.factory.AddMessageTypes(new MessageDescription[] { null }); } diff --git a/src/DotNetOpenAuth.Test/OAuth/ChannelElements/OAuthChannelTests.cs b/src/DotNetOpenAuth.Test/OAuth/ChannelElements/OAuthChannelTests.cs index 7999a44..f80935c 100644 --- a/src/DotNetOpenAuth.Test/OAuth/ChannelElements/OAuthChannelTests.cs +++ b/src/DotNetOpenAuth.Test/OAuth/ChannelElements/OAuthChannelTests.cs @@ -41,17 +41,17 @@ namespace DotNetOpenAuth.Test.OAuth.ChannelElements { this.channel.WebRequestHandler = this.webRequestHandler; } - [TestCase, ExpectedException(typeof(ArgumentException))] + [Test, ExpectedException(typeof(ArgumentException))] public void CtorNullSigner() { new OAuthConsumerChannel(null, this.nonceStore, new InMemoryTokenManager(), this.consumerSecuritySettings, new TestMessageFactory()); } - [TestCase, ExpectedException(typeof(ArgumentNullException))] + [Test, ExpectedException(typeof(ArgumentNullException))] public void CtorNullStore() { new OAuthConsumerChannel(new RsaSha1ServiceProviderSigningBindingElement(new InMemoryTokenManager()), null, new InMemoryTokenManager(), this.consumerSecuritySettings, new TestMessageFactory()); } - [TestCase, ExpectedException(typeof(ArgumentNullException))] + [Test, ExpectedException(typeof(ArgumentNullException))] public void CtorNullTokenManager() { new OAuthConsumerChannel(new RsaSha1ServiceProviderSigningBindingElement(new InMemoryTokenManager()), this.nonceStore, null, this.consumerSecuritySettings, new TestMessageFactory()); } @@ -157,18 +157,18 @@ namespace DotNetOpenAuth.Test.OAuth.ChannelElements { } } - [TestCase, ExpectedException(typeof(ArgumentNullException))] + [Test, ExpectedException(typeof(ArgumentNullException))] public void RequestNull() { this.channel.Request(null); } - [TestCase, ExpectedException(typeof(ArgumentException))] + [Test, ExpectedException(typeof(ArgumentException))] public void RequestNullRecipient() { IDirectedProtocolMessage message = new TestDirectedMessage(MessageTransport.Direct); this.channel.Request(message); } - [TestCase, ExpectedException(typeof(NotSupportedException))] + [Test, ExpectedException(typeof(NotSupportedException))] public void RequestBadPreferredScheme() { TestDirectedMessage message = new TestDirectedMessage(MessageTransport.Direct); message.Recipient = new Uri("http://localtest"); diff --git a/src/DotNetOpenAuth.Test/OAuth/ChannelElements/UriOrOobEncodingTests.cs b/src/DotNetOpenAuth.Test/OAuth/ChannelElements/UriOrOobEncodingTests.cs index 185e75b..bcc44b4 100644 --- a/src/DotNetOpenAuth.Test/OAuth/ChannelElements/UriOrOobEncodingTests.cs +++ b/src/DotNetOpenAuth.Test/OAuth/ChannelElements/UriOrOobEncodingTests.cs @@ -40,7 +40,7 @@ namespace DotNetOpenAuth.Test.OAuth.ChannelElements { /// <summary> /// Verifies that decoding an empty string generates an exception. /// </summary> - [TestCase, ExpectedException(typeof(UriFormatException))] + [Test, ExpectedException(typeof(UriFormatException))] public void DecodeEmptyStringFails() { this.encoding.Decode(string.Empty); } @@ -60,7 +60,7 @@ namespace DotNetOpenAuth.Test.OAuth.ChannelElements { /// <summary> /// Verifies failure to decode a relative Uri /// </summary> - [TestCase, ExpectedException(typeof(UriFormatException))] + [Test, ExpectedException(typeof(UriFormatException))] public void RelativeUriDecodeFails() { this.encoding.Decode("../a/b"); } diff --git a/src/DotNetOpenAuth.Test/OAuth/ServiceProviderDescriptionTests.cs b/src/DotNetOpenAuth.Test/OAuth/ServiceProviderDescriptionTests.cs index 42bb149..cdc8de5 100644 --- a/src/DotNetOpenAuth.Test/OAuth/ServiceProviderDescriptionTests.cs +++ b/src/DotNetOpenAuth.Test/OAuth/ServiceProviderDescriptionTests.cs @@ -51,7 +51,7 @@ namespace DotNetOpenAuth.Test.OAuth { /// Verifies that oauth parameters are not allowed in <see cref="ServiceProvider.RequestTokenUri"/>, /// per section OAuth 1.0 section 4.1. /// </summary> - [TestCase, ExpectedException(typeof(ArgumentException))] + [Test, ExpectedException(typeof(ArgumentException))] public void RequestTokenUriWithOAuthParametersTest() { var target = new ServiceProviderDescription(); target.RequestTokenEndpoint = new MessageReceivingEndpoint("http://localhost/requesttoken?oauth_token=something", HttpDeliveryMethods.GetRequest); diff --git a/src/DotNetOpenAuth.Test/OpenId/ChannelElements/KeyValueFormEncodingTests.cs b/src/DotNetOpenAuth.Test/OpenId/ChannelElements/KeyValueFormEncodingTests.cs index bafabe6..93ad028 100644 --- a/src/DotNetOpenAuth.Test/OpenId/ChannelElements/KeyValueFormEncodingTests.cs +++ b/src/DotNetOpenAuth.Test/OpenId/ChannelElements/KeyValueFormEncodingTests.cs @@ -117,18 +117,18 @@ namespace DotNetOpenAuth.Test.OpenId.ChannelElements { this.KVDictTest(UTF8Encoding.UTF8.GetBytes("east:west\nnorth:south"), d10, TestMode.Decoder); } - [TestCase, ExpectedException(typeof(FormatException))] + [Test, ExpectedException(typeof(FormatException))] public void NoValue() { this.Illegal("x\n", KeyValueFormConformanceLevel.OpenId11); } - [TestCase, ExpectedException(typeof(FormatException))] + [Test, ExpectedException(typeof(FormatException))] public void NoValueLoose() { Dictionary<string, string> d = new Dictionary<string, string>(); this.KVDictTest(Encoding.UTF8.GetBytes("x\n"), d, TestMode.Decoder); } - [TestCase, ExpectedException(typeof(FormatException))] + [Test, ExpectedException(typeof(FormatException))] public void EmptyLine() { this.Illegal("x:b\n\n", KeyValueFormConformanceLevel.OpenId20); } @@ -140,7 +140,7 @@ namespace DotNetOpenAuth.Test.OpenId.ChannelElements { this.KVDictTest(Encoding.UTF8.GetBytes("x:b\n\n"), d, TestMode.Decoder); } - [TestCase, ExpectedException(typeof(FormatException))] + [Test, ExpectedException(typeof(FormatException))] public void LastLineNotTerminated() { this.Illegal("x:y\na:b", KeyValueFormConformanceLevel.OpenId11); } diff --git a/src/DotNetOpenAuth.Test/OpenId/ChannelElements/SigningBindingElementTests.cs b/src/DotNetOpenAuth.Test/OpenId/ChannelElements/SigningBindingElementTests.cs index 17feaa8..f7722e3 100644 --- a/src/DotNetOpenAuth.Test/OpenId/ChannelElements/SigningBindingElementTests.cs +++ b/src/DotNetOpenAuth.Test/OpenId/ChannelElements/SigningBindingElementTests.cs @@ -75,7 +75,7 @@ namespace DotNetOpenAuth.Test.OpenId.ChannelElements { /// <summary> /// Regression test for bug #45 (https://github.com/AArnott/dotnetopenid/issues/45) /// </summary> - [TestCase, ExpectedException(typeof(ProtocolException))] + [Test, ExpectedException(typeof(ProtocolException))] public void MissingSignedParameter() { var cryptoStore = new MemoryCryptoKeyStore(); byte[] associationSecret = Convert.FromBase64String("rsSwv1zPWfjPRQU80hciu8FPDC+GONAMJQ/AvSo1a2M="); diff --git a/src/DotNetOpenAuth.Test/OpenId/DiffieHellmanTests.cs b/src/DotNetOpenAuth.Test/OpenId/DiffieHellmanTests.cs index 8512053..f81f4f0 100644 --- a/src/DotNetOpenAuth.Test/OpenId/DiffieHellmanTests.cs +++ b/src/DotNetOpenAuth.Test/OpenId/DiffieHellmanTests.cs @@ -22,7 +22,7 @@ namespace DotNetOpenAuth.Test.OpenId { Assert.AreNotEqual(s1, s2, "Secret keys should NOT be the same."); } - [TestCase, Timeout(15000), Category("Slow"), Category("Performance")] + [Test, Timeout(15000), Category("Slow"), Category("Performance")] public void TestPublic() { TextReader reader = new StringReader(OpenIdTestBase.LoadEmbeddedFile("dhpriv.txt")); diff --git a/src/DotNetOpenAuth.Test/OpenId/DiscoveryServices/UriDiscoveryServiceTests.cs b/src/DotNetOpenAuth.Test/OpenId/DiscoveryServices/UriDiscoveryServiceTests.cs index c145e23..88ad208 100644 --- a/src/DotNetOpenAuth.Test/OpenId/DiscoveryServices/UriDiscoveryServiceTests.cs +++ b/src/DotNetOpenAuth.Test/OpenId/DiscoveryServices/UriDiscoveryServiceTests.cs @@ -49,7 +49,7 @@ namespace DotNetOpenAuth.Test.OpenId.DiscoveryServices { Assert.AreEqual(1, this.Discover(userSuppliedIdentifier).Count()); } - [TestCase, ExpectedException(typeof(ProtocolException))] + [Test, ExpectedException(typeof(ProtocolException))] public void DiscoverRequireSslWithInsecureRedirect() { Identifier claimedId = this.GetMockIdentifier(ProtocolVersion.V20, true); diff --git a/src/DotNetOpenAuth.Test/OpenId/Extensions/AttributeExchange/AttributeRequestTests.cs b/src/DotNetOpenAuth.Test/OpenId/Extensions/AttributeExchange/AttributeRequestTests.cs index 337663e..123ff86 100644 --- a/src/DotNetOpenAuth.Test/OpenId/Extensions/AttributeExchange/AttributeRequestTests.cs +++ b/src/DotNetOpenAuth.Test/OpenId/Extensions/AttributeExchange/AttributeRequestTests.cs @@ -20,22 +20,22 @@ namespace DotNetOpenAuth.Test.OpenId.Extensions { Assert.IsFalse(req.IsRequired); } - [TestCase, ExpectedException(typeof(ArgumentException))] + [Test, ExpectedException(typeof(ArgumentException))] public void CtorEmptyTypeUri() { new AttributeRequest(string.Empty); } - [TestCase, ExpectedException(typeof(ArgumentNullException))] + [Test, ExpectedException(typeof(ArgumentNullException))] public void CtorNullTypeUri() { new AttributeRequest(null); } - [TestCase, ExpectedException(typeof(ArgumentOutOfRangeException))] + [Test, ExpectedException(typeof(ArgumentOutOfRangeException))] public void CtorCountZero() { new AttributeRequest(WellKnownAttributes.Contact.Email, false, 0); } - [TestCase, ExpectedException(typeof(ArgumentOutOfRangeException))] + [Test, ExpectedException(typeof(ArgumentOutOfRangeException))] public void CtorCountNegative() { new AttributeRequest(WellKnownAttributes.Contact.Email, false, -1); } @@ -48,13 +48,13 @@ namespace DotNetOpenAuth.Test.OpenId.Extensions { Assert.AreEqual(5, req.Count); } - [TestCase, ExpectedException(typeof(ArgumentOutOfRangeException))] + [Test, ExpectedException(typeof(ArgumentOutOfRangeException))] public void SetCountZero() { var req = new AttributeRequest(); req.Count = 0; } - [TestCase, ExpectedException(typeof(ArgumentOutOfRangeException))] + [Test, ExpectedException(typeof(ArgumentOutOfRangeException))] public void SetCountNegative() { var req = new AttributeRequest(); req.Count = -1; diff --git a/src/DotNetOpenAuth.Test/OpenId/Extensions/AttributeExchange/FetchRequestTests.cs b/src/DotNetOpenAuth.Test/OpenId/Extensions/AttributeExchange/FetchRequestTests.cs index 62f54a2..a9c7baf 100644 --- a/src/DotNetOpenAuth.Test/OpenId/Extensions/AttributeExchange/FetchRequestTests.cs +++ b/src/DotNetOpenAuth.Test/OpenId/Extensions/AttributeExchange/FetchRequestTests.cs @@ -13,7 +13,7 @@ namespace DotNetOpenAuth.Test.OpenId.Extensions { [TestFixture] public class FetchRequestTests : OpenIdTestBase { - [TestCase, ExpectedException(typeof(ArgumentNullException))] + [Test, ExpectedException(typeof(ArgumentNullException))] public void AddAttributeRequestNull() { new FetchRequest().Attributes.Add(null); } @@ -30,7 +30,7 @@ namespace DotNetOpenAuth.Test.OpenId.Extensions { req.Attributes.Add(new AttributeRequest() { TypeUri = "=someUri*who*knows*but*this*is*legal" }); } - [TestCase, ExpectedException(typeof(ArgumentException))] + [Test, ExpectedException(typeof(ArgumentException))] public void AddAttributeRequestAgain() { var req = new FetchRequest(); req.Attributes.Add(new AttributeRequest() { TypeUri = "http://UriTwice" }); @@ -59,7 +59,7 @@ namespace DotNetOpenAuth.Test.OpenId.Extensions { Assert.AreEqual("value2", resp.Values[1]); } - [TestCase, ExpectedException(typeof(ArgumentException))] + [Test, ExpectedException(typeof(ArgumentException))] public void RespondTooManyValues() { var req = new AttributeRequest(); req.TypeUri = "http://someType"; @@ -67,7 +67,7 @@ namespace DotNetOpenAuth.Test.OpenId.Extensions { req.Respond("value1", "value2"); } - [TestCase, ExpectedException(typeof(ArgumentNullException))] + [Test, ExpectedException(typeof(ArgumentNullException))] public void RespondNull() { var req = new AttributeRequest(); req.TypeUri = "http://someType"; diff --git a/src/DotNetOpenAuth.Test/OpenId/Extensions/AttributeExchange/FetchResponseTests.cs b/src/DotNetOpenAuth.Test/OpenId/Extensions/AttributeExchange/FetchResponseTests.cs index 53d1ef4..580cd6b 100644 --- a/src/DotNetOpenAuth.Test/OpenId/Extensions/AttributeExchange/FetchResponseTests.cs +++ b/src/DotNetOpenAuth.Test/OpenId/Extensions/AttributeExchange/FetchResponseTests.cs @@ -26,14 +26,14 @@ namespace DotNetOpenAuth.Test.OpenId.Extensions { response.Attributes.Add(new AttributeValues("http://someOtherAttribute", "Value2")); } - [TestCase, ExpectedException(typeof(ArgumentException))] + [Test, ExpectedException(typeof(ArgumentException))] public void AddAttributeTwice() { var response = new FetchResponse(); response.Attributes.Add(new AttributeValues("http://someattribute", "Value1")); response.Attributes.Add(new AttributeValues("http://someattribute", "Value1")); } - [TestCase, ExpectedException(typeof(ArgumentNullException))] + [Test, ExpectedException(typeof(ArgumentNullException))] public void AddAttributeNull() { var response = new FetchResponse(); response.Attributes.Add(null); diff --git a/src/DotNetOpenAuth.Test/OpenId/Extensions/ProviderAuthenticationPolicy/PolicyResponseTests.cs b/src/DotNetOpenAuth.Test/OpenId/Extensions/ProviderAuthenticationPolicy/PolicyResponseTests.cs index 8126d65..27ca8b7 100644 --- a/src/DotNetOpenAuth.Test/OpenId/Extensions/ProviderAuthenticationPolicy/PolicyResponseTests.cs +++ b/src/DotNetOpenAuth.Test/OpenId/Extensions/ProviderAuthenticationPolicy/PolicyResponseTests.cs @@ -67,7 +67,7 @@ namespace DotNetOpenAuth.Test.OpenId.Extensions.ProviderAuthenticationPolicy { Assert.AreEqual(someUtcTime, resp.AuthenticationTimeUtc); } - [TestCase, ExpectedException(typeof(ArgumentException))] + [Test, ExpectedException(typeof(ArgumentException))] public void AuthenticationTimeUtcSetUnspecified() { PolicyResponse resp = new PolicyResponse(); resp.AuthenticationTimeUtc = someUnspecifiedTime; diff --git a/src/DotNetOpenAuth.Test/OpenId/Extensions/SimpleRegistration/ClaimsResponseTests.cs b/src/DotNetOpenAuth.Test/OpenId/Extensions/SimpleRegistration/ClaimsResponseTests.cs index 1b2c2ec..35bfc78 100644 --- a/src/DotNetOpenAuth.Test/OpenId/Extensions/SimpleRegistration/ClaimsResponseTests.cs +++ b/src/DotNetOpenAuth.Test/OpenId/Extensions/SimpleRegistration/ClaimsResponseTests.cs @@ -24,7 +24,7 @@ namespace DotNetOpenAuth.Test.OpenId.Extensions { Assert.IsNull(response.MailAddress); } - [TestCase, Ignore("serialization no longer supported")] + [Test, Ignore("serialization no longer supported")] public void BinarySerialization() { ClaimsResponse fields = this.GetFilledData(); MemoryStream ms = new MemoryStream(); @@ -36,7 +36,7 @@ namespace DotNetOpenAuth.Test.OpenId.Extensions { Assert.AreEqual(fields, fields2); } - [TestCase, Ignore("serialization no longer supported")] + [Test, Ignore("serialization no longer supported")] public void XmlSerialization() { ClaimsResponse fields = this.GetFilledData(); MemoryStream ms = new MemoryStream(); @@ -125,7 +125,7 @@ namespace DotNetOpenAuth.Test.OpenId.Extensions { Assert.IsFalse(response.BirthDate.HasValue); } - [TestCase, ExpectedException(typeof(ArgumentException))] + [Test, ExpectedException(typeof(ArgumentException))] public void InvalidRawBirthdate() { var response = new ClaimsResponse(); response.BirthDateRaw = "2008"; diff --git a/src/DotNetOpenAuth.Test/OpenId/IdentifierTests.cs b/src/DotNetOpenAuth.Test/OpenId/IdentifierTests.cs index ee9ad6b..f44d23e 100644 --- a/src/DotNetOpenAuth.Test/OpenId/IdentifierTests.cs +++ b/src/DotNetOpenAuth.Test/OpenId/IdentifierTests.cs @@ -75,12 +75,12 @@ namespace DotNetOpenAuth.Test.OpenId { Assert.AreEqual(this.uri, ((UriIdentifier)id).Uri.AbsoluteUri); } - [TestCase, ExpectedException(typeof(ArgumentNullException))] + [Test, ExpectedException(typeof(ArgumentNullException))] public void ParseNull() { Identifier.Parse(null); } - [TestCase, ExpectedException(typeof(ArgumentException))] + [Test, ExpectedException(typeof(ArgumentException))] public void ParseEmpty() { Identifier.Parse(string.Empty); } diff --git a/src/DotNetOpenAuth.Test/OpenId/Messages/AssociateRequestTests.cs b/src/DotNetOpenAuth.Test/OpenId/Messages/AssociateRequestTests.cs index 72931c5..5d38eda 100644 --- a/src/DotNetOpenAuth.Test/OpenId/Messages/AssociateRequestTests.cs +++ b/src/DotNetOpenAuth.Test/OpenId/Messages/AssociateRequestTests.cs @@ -58,7 +58,7 @@ namespace DotNetOpenAuth.Test.OpenId.Messages { this.request.EnsureValidMessage(); } - [TestCase, ExpectedException(typeof(ProtocolException))] + [Test, ExpectedException(typeof(ProtocolException))] public void InvalidMessageTest() { this.request = new AssociateUnencryptedRequest(Protocol.V20.Version, this.insecureRecipient); this.request.AssociationType = this.protocol.Args.SignatureAlgorithm.HMAC_SHA1; diff --git a/src/DotNetOpenAuth.Test/OpenId/Messages/IndirectSignedResponseTests.cs b/src/DotNetOpenAuth.Test/OpenId/Messages/IndirectSignedResponseTests.cs index ac49a14..458b081 100644 --- a/src/DotNetOpenAuth.Test/OpenId/Messages/IndirectSignedResponseTests.cs +++ b/src/DotNetOpenAuth.Test/OpenId/Messages/IndirectSignedResponseTests.cs @@ -125,12 +125,12 @@ namespace DotNetOpenAuth.Test.OpenId.Messages { } } - [TestCase, ExpectedException(typeof(ArgumentNullException))] + [Test, ExpectedException(typeof(ArgumentNullException))] public void GetReturnToArgumentNullKey() { this.response.GetReturnToArgument(null); } - [TestCase, ExpectedException(typeof(ArgumentException))] + [Test, ExpectedException(typeof(ArgumentException))] public void GetReturnToArgumentEmptyKey() { this.response.GetReturnToArgument(string.Empty); } diff --git a/src/DotNetOpenAuth.Test/OpenId/Messages/NegativeAssertionResponseTests.cs b/src/DotNetOpenAuth.Test/OpenId/Messages/NegativeAssertionResponseTests.cs index 76178b0..a4d33d2 100644 --- a/src/DotNetOpenAuth.Test/OpenId/Messages/NegativeAssertionResponseTests.cs +++ b/src/DotNetOpenAuth.Test/OpenId/Messages/NegativeAssertionResponseTests.cs @@ -45,7 +45,7 @@ namespace DotNetOpenAuth.Test.OpenId.Messages { Assert.IsFalse(new NegativeAssertionResponse(setupRequestV2).Immediate); } - [TestCase, ExpectedException(typeof(ProtocolException))] + [Test, ExpectedException(typeof(ProtocolException))] public void UserSetupUrlRequiredInV1Immediate() { var immediateRequestV1 = new CheckIdRequest(Protocol.V10.Version, OPUri, AuthenticationRequestMode.Immediate); immediateRequestV1.ReturnTo = RPUri; diff --git a/src/DotNetOpenAuth.Test/OpenId/Messages/SignedResponseRequestTests.cs b/src/DotNetOpenAuth.Test/OpenId/Messages/SignedResponseRequestTests.cs index ee660e5..bb6a59c 100644 --- a/src/DotNetOpenAuth.Test/OpenId/Messages/SignedResponseRequestTests.cs +++ b/src/DotNetOpenAuth.Test/OpenId/Messages/SignedResponseRequestTests.cs @@ -55,7 +55,7 @@ namespace DotNetOpenAuth.Test.OpenId.Messages { /// This test does not test all the realm-return_to matching rules as that is done in the Realm tests. /// This test merely checks that the compatibility match occurs at all. /// </remarks> - [TestCase, ExpectedException(typeof(ProtocolException))] + [Test, ExpectedException(typeof(ProtocolException))] public void RealmReturnToMismatchV2() { this.setupv2.Realm = "http://somehost/"; this.setupv2.ReturnTo = new Uri("http://someotherhost/"); @@ -66,7 +66,7 @@ namespace DotNetOpenAuth.Test.OpenId.Messages { /// Verifies that the validation check throws if the return_to and the realm /// values are not compatible. /// </summary> - [TestCase, ExpectedException(typeof(ProtocolException))] + [Test, ExpectedException(typeof(ProtocolException))] public void RealmReturnToMismatchV1() { this.setupv1.Realm = "http://somehost/"; this.setupv1.ReturnTo = new Uri("http://someotherhost/"); diff --git a/src/DotNetOpenAuth.Test/OpenId/Provider/OpenIdProviderTests.cs b/src/DotNetOpenAuth.Test/OpenId/Provider/OpenIdProviderTests.cs index 598aeb7..c15f5b8 100644 --- a/src/DotNetOpenAuth.Test/OpenId/Provider/OpenIdProviderTests.cs +++ b/src/DotNetOpenAuth.Test/OpenId/Provider/OpenIdProviderTests.cs @@ -31,7 +31,7 @@ namespace DotNetOpenAuth.Test.OpenId.Provider { /// <summary> /// Verifies that the constructor throws an exception if the app store is null. /// </summary> - [TestCase, ExpectedException(typeof(ArgumentNullException))] + [Test, ExpectedException(typeof(ArgumentNullException))] public void CtorNull() { new OpenIdProvider(null); } @@ -39,7 +39,7 @@ namespace DotNetOpenAuth.Test.OpenId.Provider { /// <summary> /// Verifies that the SecuritySettings property throws when set to null. /// </summary> - [TestCase, ExpectedException(typeof(ArgumentNullException))] + [Test, ExpectedException(typeof(ArgumentNullException))] public void SecuritySettingsSetNull() { this.provider.SecuritySettings = null; } @@ -73,7 +73,7 @@ namespace DotNetOpenAuth.Test.OpenId.Provider { /// <summary> /// Verifies the GetRequest method throws outside an HttpContext. /// </summary> - [TestCase, ExpectedException(typeof(InvalidOperationException))] + [Test, ExpectedException(typeof(InvalidOperationException))] public void GetRequestNoContext() { HttpContext.Current = null; this.provider.GetRequest(); @@ -82,7 +82,7 @@ namespace DotNetOpenAuth.Test.OpenId.Provider { /// <summary> /// Verifies GetRequest throws on null input. /// </summary> - [TestCase, ExpectedException(typeof(ArgumentNullException))] + [Test, ExpectedException(typeof(ArgumentNullException))] public void GetRequestNull() { this.provider.GetRequest(null); } @@ -126,7 +126,7 @@ namespace DotNetOpenAuth.Test.OpenId.Provider { coordinator.Run(); } - [TestCase, Category("HostASPNET")] + [Test, Category("HostASPNET")] public void BadRequestsGenerateValidErrorResponsesHosted() { try { using (AspNetHost host = AspNetHost.CreateHost(TestWebDirectory)) { diff --git a/src/DotNetOpenAuth.Test/OpenId/ProviderEndpointDescriptionTests.cs b/src/DotNetOpenAuth.Test/OpenId/ProviderEndpointDescriptionTests.cs index 783bf1f..f406f0e 100644 --- a/src/DotNetOpenAuth.Test/OpenId/ProviderEndpointDescriptionTests.cs +++ b/src/DotNetOpenAuth.Test/OpenId/ProviderEndpointDescriptionTests.cs @@ -20,7 +20,7 @@ namespace DotNetOpenAuth.Test.OpenId { Assert.IsNotNull(epd.Capabilities); } - [TestCase, ExpectedException(typeof(ProtocolException))] + [Test, ExpectedException(typeof(ProtocolException))] public void ProtocolDetectionWithoutClues() { new ProviderEndpointDescription(OPUri, new[] { Protocol.V20.HtmlDiscoveryLocalIdKey }); // random type URI irrelevant to detection } diff --git a/src/DotNetOpenAuth.Test/OpenId/RelyingParty/AuthenticationRequestTests.cs b/src/DotNetOpenAuth.Test/OpenId/RelyingParty/AuthenticationRequestTests.cs index a7e9144..cd72fdb 100644 --- a/src/DotNetOpenAuth.Test/OpenId/RelyingParty/AuthenticationRequestTests.cs +++ b/src/DotNetOpenAuth.Test/OpenId/RelyingParty/AuthenticationRequestTests.cs @@ -194,7 +194,7 @@ namespace DotNetOpenAuth.Test.OpenId.RelyingParty { /// Verifies that authentication requests are generated first for OPs that respond /// to authentication requests. /// </summary> - [TestCase, Ignore("Not yet implemented")] + [Test, Ignore("Not yet implemented")] public void UnresponsiveProvidersComeLast() { // TODO: code here Assert.Inconclusive("Not yet implemented."); diff --git a/src/DotNetOpenAuth.Test/OpenId/RelyingParty/FailedAuthenticationResponseTests.cs b/src/DotNetOpenAuth.Test/OpenId/RelyingParty/FailedAuthenticationResponseTests.cs index 1b01b7e..cf05a7e 100644 --- a/src/DotNetOpenAuth.Test/OpenId/RelyingParty/FailedAuthenticationResponseTests.cs +++ b/src/DotNetOpenAuth.Test/OpenId/RelyingParty/FailedAuthenticationResponseTests.cs @@ -27,7 +27,7 @@ namespace DotNetOpenAuth.Test.OpenId.RelyingParty { this.response = new FailedAuthenticationResponse(this.exception); } - [TestCase, ExpectedException(typeof(ArgumentNullException))] + [Test, ExpectedException(typeof(ArgumentNullException))] public void CtorNull() { new FailedAuthenticationResponse(null); } diff --git a/src/DotNetOpenAuth.Test/OpenId/RelyingParty/IdentifierDiscoveryResultTests.cs b/src/DotNetOpenAuth.Test/OpenId/RelyingParty/IdentifierDiscoveryResultTests.cs index 929a0fb..08e5a46 100644 --- a/src/DotNetOpenAuth.Test/OpenId/RelyingParty/IdentifierDiscoveryResultTests.cs +++ b/src/DotNetOpenAuth.Test/OpenId/RelyingParty/IdentifierDiscoveryResultTests.cs @@ -143,37 +143,37 @@ namespace DotNetOpenAuth.Test.OpenId.RelyingParty { Assert.IsFalse(se.IsTypeUriPresent("http://someother")); } - [TestCase, ExpectedException(typeof(ArgumentNullException))] + [Test, ExpectedException(typeof(ArgumentNullException))] public void IsTypeUriPresentNull() { IdentifierDiscoveryResult se = IdentifierDiscoveryResult.CreateForClaimedIdentifier(this.claimedXri, this.userSuppliedXri, this.localId, new ProviderEndpointDescription(this.providerEndpoint, this.v20TypeUris), this.servicePriority, this.uriPriority); se.IsTypeUriPresent(null); } - [TestCase, ExpectedException(typeof(ArgumentException))] + [Test, ExpectedException(typeof(ArgumentException))] public void IsTypeUriPresentEmpty() { IdentifierDiscoveryResult se = IdentifierDiscoveryResult.CreateForClaimedIdentifier(this.claimedXri, this.userSuppliedXri, this.localId, new ProviderEndpointDescription(this.providerEndpoint, this.v20TypeUris), this.servicePriority, this.uriPriority); se.IsTypeUriPresent(string.Empty); } - [TestCase, ExpectedException(typeof(ArgumentNullException))] + [Test, ExpectedException(typeof(ArgumentNullException))] public void IsExtensionSupportedNullType() { var se = IdentifierDiscoveryResult.CreateForProviderIdentifier(OPUri, new ProviderEndpointDescription(OPUri, this.v20TypeUris), null, null); se.IsExtensionSupported((Type)null); } - [TestCase, ExpectedException(typeof(ArgumentNullException))] + [Test, ExpectedException(typeof(ArgumentNullException))] public void IsTypeUriPresentNullString() { var se = IdentifierDiscoveryResult.CreateForProviderIdentifier(OPUri, new ProviderEndpointDescription(OPUri, this.v20TypeUris), null, null); se.IsTypeUriPresent((string)null); } - [TestCase, ExpectedException(typeof(ArgumentException))] + [Test, ExpectedException(typeof(ArgumentException))] public void IsTypeUriPresentEmptyString() { var se = IdentifierDiscoveryResult.CreateForProviderIdentifier(OPUri, new ProviderEndpointDescription(OPUri, this.v20TypeUris), null, null); se.IsTypeUriPresent(string.Empty); } - [TestCase, ExpectedException(typeof(ArgumentNullException))] + [Test, ExpectedException(typeof(ArgumentNullException))] public void IsExtensionSupportedNullExtension() { var se = IdentifierDiscoveryResult.CreateForProviderIdentifier(OPUri, new ProviderEndpointDescription(OPUri, this.v20TypeUris), null, null); se.IsExtensionSupported((IOpenIdMessageExtension)null); diff --git a/src/DotNetOpenAuth.Test/OpenId/RelyingParty/NegativeAuthenticationResponseTests.cs b/src/DotNetOpenAuth.Test/OpenId/RelyingParty/NegativeAuthenticationResponseTests.cs index 60a7318..167a93c 100644 --- a/src/DotNetOpenAuth.Test/OpenId/RelyingParty/NegativeAuthenticationResponseTests.cs +++ b/src/DotNetOpenAuth.Test/OpenId/RelyingParty/NegativeAuthenticationResponseTests.cs @@ -32,7 +32,7 @@ namespace DotNetOpenAuth.Test.OpenId.RelyingParty { this.response = new NegativeAuthenticationResponse(this.responseMessage); } - [TestCase, ExpectedException(typeof(ArgumentNullException))] + [Test, ExpectedException(typeof(ArgumentNullException))] public void CtorNull() { new NegativeAuthenticationResponse(null); } diff --git a/src/DotNetOpenAuth.Test/OpenId/RelyingParty/OpenIdRelyingPartyTests.cs b/src/DotNetOpenAuth.Test/OpenId/RelyingParty/OpenIdRelyingPartyTests.cs index 86dd68c..a2a4efa 100644 --- a/src/DotNetOpenAuth.Test/OpenId/RelyingParty/OpenIdRelyingPartyTests.cs +++ b/src/DotNetOpenAuth.Test/OpenId/RelyingParty/OpenIdRelyingPartyTests.cs @@ -30,7 +30,7 @@ namespace DotNetOpenAuth.Test.OpenId.RelyingParty { Assert.IsNull(requestMessage.AssociationHandle); } - [TestCase, ExpectedException(typeof(ArgumentNullException))] + [Test, ExpectedException(typeof(ArgumentNullException))] public void SecuritySettingsSetNull() { var rp = new OpenIdRelyingParty(new StandardRelyingPartyApplicationStore()); rp.SecuritySettings = null; @@ -78,7 +78,7 @@ namespace DotNetOpenAuth.Test.OpenId.RelyingParty { Assert.AreEqual(0, requests.Count()); } - [TestCase, ExpectedException(typeof(ProtocolException))] + [Test, ExpectedException(typeof(ProtocolException))] public void CreateRequestOnNonOpenID() { Uri nonOpenId = new Uri("http://www.microsoft.com/"); var rp = this.CreateRelyingParty(); diff --git a/src/DotNetOpenAuth.Test/OpenId/RelyingParty/PositiveAuthenticationResponseTests.cs b/src/DotNetOpenAuth.Test/OpenId/RelyingParty/PositiveAuthenticationResponseTests.cs index f71f4be..91318f5 100644 --- a/src/DotNetOpenAuth.Test/OpenId/RelyingParty/PositiveAuthenticationResponseTests.cs +++ b/src/DotNetOpenAuth.Test/OpenId/RelyingParty/PositiveAuthenticationResponseTests.cs @@ -62,7 +62,7 @@ namespace DotNetOpenAuth.Test.OpenId.RelyingParty { /// Verifies that discovery verification of a positive assertion cannot match a dual identifier /// if the default settings are in place. /// </summary> - [TestCase, ExpectedException(typeof(ProtocolException))] + [Test, ExpectedException(typeof(ProtocolException))] public void DualIdentifierNoMatchInAssertionVerificationByDefault() { PositiveAssertionResponse assertion = this.GetPositiveAssertion(true); ClaimsResponse extension = new ClaimsResponse(); @@ -76,7 +76,7 @@ namespace DotNetOpenAuth.Test.OpenId.RelyingParty { /// makes up a claimed Id that was not part of the original request, and /// that the OP has no authority to assert positively regarding. /// </summary> - [TestCase, ExpectedException(typeof(ProtocolException))] + [Test, ExpectedException(typeof(ProtocolException))] public void SpoofedClaimedIdDetectionSolicited() { PositiveAssertionResponse assertion = this.GetPositiveAssertion(); assertion.ProviderEndpoint = new Uri("http://rogueOP"); @@ -89,7 +89,7 @@ namespace DotNetOpenAuth.Test.OpenId.RelyingParty { /// Verifies that the RP rejects positive assertions with HTTP Claimed /// Cdentifiers when RequireSsl is set to true. /// </summary> - [TestCase, ExpectedException(typeof(ProtocolException))] + [Test, ExpectedException(typeof(ProtocolException))] public void InsecureIdentifiersRejectedWithRequireSsl() { PositiveAssertionResponse assertion = this.GetPositiveAssertion(); var rp = CreateRelyingParty(); diff --git a/src/DotNetOpenAuth.Test/OpenId/UriIdentifierTests.cs b/src/DotNetOpenAuth.Test/OpenId/UriIdentifierTests.cs index 0c63113..b6a52a7 100644 --- a/src/DotNetOpenAuth.Test/OpenId/UriIdentifierTests.cs +++ b/src/DotNetOpenAuth.Test/OpenId/UriIdentifierTests.cs @@ -26,22 +26,22 @@ namespace DotNetOpenAuth.Test.OpenId { base.SetUp(); } - [TestCase, ExpectedException(typeof(ArgumentNullException))] + [Test, ExpectedException(typeof(ArgumentNullException))] public void CtorNullUri() { new UriIdentifier((Uri)null); } - [TestCase, ExpectedException(typeof(ArgumentNullException))] + [Test, ExpectedException(typeof(ArgumentNullException))] public void CtorNullString() { new UriIdentifier((string)null); } - [TestCase, ExpectedException(typeof(ArgumentException))] + [Test, ExpectedException(typeof(ArgumentException))] public void CtorBlank() { new UriIdentifier(string.Empty); } - [TestCase, ExpectedException(typeof(UriFormatException))] + [Test, ExpectedException(typeof(UriFormatException))] public void CtorBadUri() { new UriIdentifier(this.badUri); } @@ -68,7 +68,7 @@ namespace DotNetOpenAuth.Test.OpenId { Assert.IsTrue(uri.IsDiscoverySecureEndToEnd); } - [TestCase, ExpectedException(typeof(ArgumentException))] + [Test, ExpectedException(typeof(ArgumentException))] public void CtorStringHttpSchemeSecure() { new UriIdentifier("http://host/path", true); } @@ -80,7 +80,7 @@ namespace DotNetOpenAuth.Test.OpenId { Assert.IsTrue(uri.IsDiscoverySecureEndToEnd); } - [TestCase, ExpectedException(typeof(ArgumentException))] + [Test, ExpectedException(typeof(ArgumentException))] public void CtorUriHttpSchemeSecure() { new UriIdentifier(new Uri("http://host/path"), true); } @@ -235,7 +235,7 @@ namespace DotNetOpenAuth.Test.OpenId { Assert.IsTrue(id.SchemeImplicitlyPrepended); } - ////[TestCase, Ignore("The spec says http:// must be prepended in this case, but that just creates an invalid URI. Our UntrustedWebRequest will stop disallowed schemes.")] + ////[Test, Ignore("The spec says http:// must be prepended in this case, but that just creates an invalid URI. Our UntrustedWebRequest will stop disallowed schemes.")] public void CtorDisallowedScheme() { UriIdentifier id = new UriIdentifier(new Uri("ftp://host/path")); Assert.AreEqual("http://ftp://host/path", id.ToString()); diff --git a/src/DotNetOpenAuth.Test/OpenId/XriIdentifierTests.cs b/src/DotNetOpenAuth.Test/OpenId/XriIdentifierTests.cs index e6871f8..e025420 100644 --- a/src/DotNetOpenAuth.Test/OpenId/XriIdentifierTests.cs +++ b/src/DotNetOpenAuth.Test/OpenId/XriIdentifierTests.cs @@ -22,17 +22,17 @@ namespace DotNetOpenAuth.Test.OpenId { base.SetUp(); } - [TestCase, ExpectedException(typeof(ArgumentNullException))] + [Test, ExpectedException(typeof(ArgumentNullException))] public void CtorNull() { new XriIdentifier(null); } - [TestCase, ExpectedException(typeof(ArgumentException))] + [Test, ExpectedException(typeof(ArgumentException))] public void CtorBlank() { new XriIdentifier(string.Empty); } - [TestCase, ExpectedException(typeof(FormatException))] + [Test, ExpectedException(typeof(FormatException))] public void CtorBadXri() { new XriIdentifier(this.badXri); } @@ -88,7 +88,7 @@ namespace DotNetOpenAuth.Test.OpenId { Assert.IsTrue(new XriIdentifier(this.goodXri).Equals(this.goodXri)); } - [TestCase, Ignore("XRI parsing and normalization is not implemented (yet).")] + [Test, Ignore("XRI parsing and normalization is not implemented (yet).")] public void NormalizeCase() { Identifier id = "=!9B72.7dd1.50a9.5ccd"; Assert.AreEqual("=!9B72.7DD1.50A9.5CCD", id.ToString()); |