Skip to content
This repository was archived by the owner on Mar 20, 2019. It is now read-only.

Commit 22b1c05

Browse files
committed
Changed all uses of [TestCase] to [Test] to better emulate recommended NUnit patterns.
1 parent 7da4839 commit 22b1c05

90 files changed

Lines changed: 425 additions & 425 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/DotNetOpenAuth.Test/Configuration/SectionTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace DotNetOpenAuth.Test.Configuration {
1313

1414
[TestFixture]
1515
public class SectionTests {
16-
[TestCase]
16+
[Test]
1717
public void UntrustedWebRequest() {
1818
var uwr = DotNetOpenAuthSection.Messaging.UntrustedWebRequest;
1919

@@ -29,12 +29,12 @@ public void UntrustedWebRequest() {
2929
Assert.IsTrue(uwr.WhitelistHostsRegex.KeysAsStrings.Contains(".+trusted.+"));
3030
}
3131

32-
[TestCase]
32+
[Test]
3333
public void OpenIdMaxAuthenticationTime() {
3434
Assert.AreEqual(TimeSpan.Parse("00:08:17"), OpenIdElement.Configuration.MaxAuthenticationTime);
3535
}
3636

37-
[TestCase]
37+
[Test]
3838
public void OpenIdRelyingParty() {
3939
var rp = OpenIdElement.Configuration.RelyingParty;
4040
Assert.IsNull(rp.ApplicationStore.CustomType);
@@ -45,7 +45,7 @@ public void OpenIdRelyingParty() {
4545
Assert.IsFalse(rp.SecuritySettings.RequireSsl);
4646
}
4747

48-
[TestCase]
48+
[Test]
4949
public void OpenIdProvider() {
5050
var op = OpenIdElement.Configuration.Provider;
5151
Assert.IsNull(op.ApplicationStore.CustomType);

src/DotNetOpenAuth.Test/Hosting/HostingTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace DotNetOpenAuth.Test.Hosting {
1616

1717
[TestFixture, Category("HostASPNET")]
1818
public class HostingTests : TestBase {
19-
[TestCase]
19+
[Test]
2020
public void AspHostBasicTest() {
2121
try {
2222
using (AspNetHost host = AspNetHost.CreateHost(TestWebDirectory)) {

src/DotNetOpenAuth.Test/Messaging/Bindings/StandardExpirationBindingElementTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace DotNetOpenAuth.Test.Messaging.Bindings {
1515

1616
[TestFixture]
1717
public class StandardExpirationBindingElementTests : MessagingTestBase {
18-
[TestCase]
18+
[Test]
1919
public void SendSetsTimestamp() {
2020
TestExpiringMessage message = new TestExpiringMessage(MessageTransport.Indirect);
2121
message.Recipient = new Uri("http://localtest");
@@ -26,13 +26,13 @@ public void SendSetsTimestamp() {
2626
Assert.IsTrue(DateTime.UtcNow - ((IExpiringProtocolMessage)message).UtcCreationDate < TimeSpan.FromSeconds(3), "The timestamp on the message was not set on send.");
2727
}
2828

29-
[TestCase]
29+
[Test]
3030
public void VerifyGoodTimestampIsAccepted() {
3131
this.Channel = CreateChannel(MessageProtections.Expiration);
3232
this.ParameterizedReceiveProtectedTest(DateTime.UtcNow, false);
3333
}
3434

35-
[TestCase]
35+
[Test]
3636
public void VerifyFutureTimestampWithinClockSkewIsAccepted() {
3737
this.Channel = CreateChannel(MessageProtections.Expiration);
3838
this.ParameterizedReceiveProtectedTest(DateTime.UtcNow + DotNetOpenAuthSection.Messaging.MaximumClockSkew - TimeSpan.FromSeconds(1), false);

src/DotNetOpenAuth.Test/Messaging/Bindings/StandardReplayProtectionBindingElementTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public override void SetUp() {
3939
/// <summary>
4040
/// Verifies that the generated nonce includes random characters.
4141
/// </summary>
42-
[TestCase]
42+
[Test]
4343
public void RandomCharactersTest() {
4444
Assert.IsNotNull(this.nonceElement.ProcessOutgoingMessage(this.message));
4545
Assert.IsNotNull(this.message.Nonce, "No nonce was set on the message.");
@@ -56,7 +56,7 @@ public void RandomCharactersTest() {
5656
/// <summary>
5757
/// Verifies that a message is received correctly.
5858
/// </summary>
59-
[TestCase]
59+
[Test]
6060
public void ValidMessageReceivedTest() {
6161
this.message.Nonce = "a";
6262
Assert.IsNotNull(this.nonceElement.ProcessIncomingMessage(this.message));
@@ -65,7 +65,7 @@ public void ValidMessageReceivedTest() {
6565
/// <summary>
6666
/// Verifies that a message that doesn't have a string of random characters is received correctly.
6767
/// </summary>
68-
[TestCase]
68+
[Test]
6969
public void ValidMessageNoNonceReceivedTest() {
7070
this.message.Nonce = string.Empty;
7171
this.nonceElement.AllowZeroLengthNonce = true;

src/DotNetOpenAuth.Test/Messaging/ChannelTests.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ public void CtorNull() {
2424
new TestBadChannel(true);
2525
}
2626

27-
[TestCase]
27+
[Test]
2828
public void ReadFromRequestQueryString() {
2929
this.ParameterizedReceiveTest("GET");
3030
}
3131

32-
[TestCase]
32+
[Test]
3333
public void ReadFromRequestForm() {
3434
this.ParameterizedReceiveTest("POST");
3535
}
@@ -68,7 +68,7 @@ public void SendInvalidMessageTransport() {
6868
this.Channel.PrepareResponse(message);
6969
}
7070

71-
[TestCase]
71+
[Test]
7272
public void SendIndirectMessage301Get() {
7373
TestDirectedMessage message = new TestDirectedMessage(MessageTransport.Indirect);
7474
GetStandardTestMessage(FieldFill.CompleteBeforeBindings, message);
@@ -109,7 +109,7 @@ public void SendIndirectMessage301GetNullFields() {
109109
badChannel.Create301RedirectResponse(message, null);
110110
}
111111

112-
[TestCase]
112+
[Test]
113113
public void SendIndirectMessageFormPost() {
114114
// We craft a very large message to force fallback to form POST.
115115
// We'll also stick some HTML reserved characters in the string value
@@ -183,13 +183,13 @@ public void ReceiveNull() {
183183
badChannel.Receive(null, null);
184184
}
185185

186-
[TestCase]
186+
[Test]
187187
public void ReceiveUnrecognizedMessage() {
188188
TestBadChannel badChannel = new TestBadChannel(false);
189189
Assert.IsNull(badChannel.Receive(new Dictionary<string, string>(), null));
190190
}
191191

192-
[TestCase]
192+
[Test]
193193
public void ReadFromRequestWithContext() {
194194
var fields = GetStandardTestFields(FieldFill.AllRequired);
195195
TestMessage expectedMessage = GetStandardTestMessage(FieldFill.AllRequired);
@@ -214,7 +214,7 @@ public void ReadFromRequestNull() {
214214
badChannel.ReadFromRequest(null);
215215
}
216216

217-
[TestCase]
217+
[Test]
218218
public void SendReplayProtectedMessageSetsNonce() {
219219
TestReplayProtectedMessage message = new TestReplayProtectedMessage(MessageTransport.Indirect);
220220
message.Recipient = new Uri("http://localtest");
@@ -230,7 +230,7 @@ public void ReceivedInvalidSignature() {
230230
this.ParameterizedReceiveProtectedTest(DateTime.UtcNow, true);
231231
}
232232

233-
[TestCase]
233+
[Test]
234234
public void ReceivedReplayProtectedMessageJustOnce() {
235235
this.Channel = CreateChannel(MessageProtections.ReplayProtection);
236236
this.ParameterizedReceiveProtectedTest(DateTime.UtcNow, false);
@@ -259,7 +259,7 @@ public void TooManyBindingElementsProvidingSameProtection() {
259259
channel.ProcessOutgoingMessageTestHook(new TestSignedDirectedMessage());
260260
}
261261

262-
[TestCase]
262+
[Test]
263263
public void BindingElementsOrdering() {
264264
IChannelBindingElement transformA = new MockTransformationBindingElement("a");
265265
IChannelBindingElement transformB = new MockTransformationBindingElement("b");

src/DotNetOpenAuth.Test/Messaging/EnumerableCacheTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public void Setup() {
3737
this.generatorCompleted = 0;
3838
}
3939

40-
[TestCase]
40+
[Test]
4141
public void EnumerableCache() {
4242
// Baseline
4343
var generator = this.NumberGenerator();
@@ -58,7 +58,7 @@ public void EnumerableCache() {
5858
CollectionAssert.AreEqual(list1, list4);
5959
}
6060

61-
[TestCase]
61+
[Test]
6262
public void GeneratesOnlyRequiredElements() {
6363
var generator = this.NumberGenerator().CacheGeneratedResults();
6464
Assert.AreEqual(0, this.generatorInvocations);
@@ -67,28 +67,28 @@ public void GeneratesOnlyRequiredElements() {
6767
Assert.AreEqual(0, this.generatorCompleted, "Only taking part of the list should not have completed the generator.");
6868
}
6969

70-
[TestCase]
70+
[Test]
7171
public void PassThruDoubleCache() {
7272
var cache1 = this.NumberGenerator().CacheGeneratedResults();
7373
var cache2 = cache1.CacheGeneratedResults();
7474
Assert.AreSame(cache1, cache2, "Two caches were set up rather than just sharing the first one.");
7575
}
7676

77-
[TestCase]
77+
[Test]
7878
public void PassThruList() {
7979
var list = this.NumberGenerator().ToList();
8080
var cache = list.CacheGeneratedResults();
8181
Assert.AreSame(list, cache);
8282
}
8383

84-
[TestCase]
84+
[Test]
8585
public void PassThruArray() {
8686
var array = this.NumberGenerator().ToArray();
8787
var cache = array.CacheGeneratedResults();
8888
Assert.AreSame(array, cache);
8989
}
9090

91-
[TestCase]
91+
[Test]
9292
public void PassThruCollection() {
9393
var collection = new Collection<int>();
9494
var cache = collection.CacheGeneratedResults();

src/DotNetOpenAuth.Test/Messaging/ErrorUtilitiesTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public void VerifyArgumentNotNullThrows() {
1616
ErrorUtilities.VerifyArgumentNotNull(null, "someArg");
1717
}
1818

19-
[TestCase]
19+
[Test]
2020
public void VerifyArgumentNotNullDoesNotThrow() {
2121
ErrorUtilities.VerifyArgumentNotNull("hi", "someArg");
2222
}
@@ -31,7 +31,7 @@ public void VerifyNonZeroLengthOnEmpty() {
3131
ErrorUtilities.VerifyNonZeroLength(string.Empty, "someArg");
3232
}
3333

34-
[TestCase]
34+
[Test]
3535
public void VerifyNonZeroLengthOnNonEmpty() {
3636
ErrorUtilities.VerifyNonZeroLength("some Value", "someArg");
3737
}

src/DotNetOpenAuth.Test/Messaging/HttpRequestInfoTests.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ namespace DotNetOpenAuth.Test.Messaging {
1313

1414
[TestFixture]
1515
public class HttpRequestInfoTests : TestBase {
16-
[TestCase]
16+
[Test]
1717
public void CtorDefault() {
1818
HttpRequestInfo info = new HttpRequestInfo();
1919
Assert.AreEqual("GET", info.HttpMethod);
2020
}
2121

22-
[TestCase]
22+
[Test]
2323
public void CtorRequest() {
2424
HttpRequest request = new HttpRequest("file", "http://someserver?a=b", "a=b");
2525
////request.Headers["headername"] = "headervalue"; // PlatformNotSupportedException prevents us mocking this up
@@ -33,7 +33,7 @@ public void CtorRequest() {
3333
}
3434

3535
// All these tests are ineffective because ServerVariables[] cannot be set.
36-
////[TestCase]
36+
////[Test]
3737
////public void CtorRequestWithDifferentPublicHttpHost() {
3838
//// HttpRequest request = new HttpRequest("file", "http://someserver?a=b", "a=b");
3939
//// request.ServerVariables["HTTP_HOST"] = "publichost";
@@ -44,7 +44,7 @@ public void CtorRequest() {
4444
//// Assert.AreEqual(request.QueryString["a"], info.QueryString["a"]);
4545
////}
4646

47-
////[TestCase]
47+
////[Test]
4848
////public void CtorRequestWithDifferentPublicHttpsHost() {
4949
//// HttpRequest request = new HttpRequest("file", "https://someserver?a=b", "a=b");
5050
//// request.ServerVariables["HTTP_HOST"] = "publichost";
@@ -55,7 +55,7 @@ public void CtorRequest() {
5555
//// Assert.AreEqual(request.QueryString["a"], info.QueryString["a"]);
5656
////}
5757

58-
////[TestCase]
58+
////[Test]
5959
////public void CtorRequestWithDifferentPublicHostNonstandardPort() {
6060
//// HttpRequest request = new HttpRequest("file", "http://someserver?a=b", "a=b");
6161
//// request.ServerVariables["HTTP_HOST"] = "publichost:550";
@@ -66,7 +66,7 @@ public void CtorRequest() {
6666
//// Assert.AreEqual(request.QueryString["a"], info.QueryString["a"]);
6767
////}
6868

69-
////[TestCase]
69+
////[Test]
7070
////public void CtorRequestWithDifferentPublicIPv6Host() {
7171
//// HttpRequest request = new HttpRequest("file", "http://[fe80::587e:c6e5:d3aa:657a]:8089/v3.1/", "");
7272
//// request.ServerVariables["HTTP_HOST"] = "[fe80::587e:c6e5:d3aa:657b]:8089";
@@ -80,7 +80,7 @@ public void CtorRequest() {
8080
/// Checks that a property dependent on another null property
8181
/// doesn't generate a NullReferenceException.
8282
/// </summary>
83-
[TestCase]
83+
[Test]
8484
public void QueryBeforeSettingUrl() {
8585
HttpRequestInfo info = new HttpRequestInfo();
8686
Assert.IsNull(info.Query);
@@ -89,7 +89,7 @@ public void QueryBeforeSettingUrl() {
8989
/// <summary>
9090
/// Verifies that looking up a querystring variable is gracefully handled without a query in the URL.
9191
/// </summary>
92-
[TestCase]
92+
[Test]
9393
public void QueryStringLookupWithoutQuery() {
9494
HttpRequestInfo info = new HttpRequestInfo();
9595
Assert.IsNull(info.QueryString["hi"]);
@@ -98,7 +98,7 @@ public void QueryStringLookupWithoutQuery() {
9898
/// <summary>
9999
/// Verifies SSL forwarders are correctly handled when they supply X_FORWARDED_PROTO and HOST
100100
/// </summary>
101-
[TestCase]
101+
[Test]
102102
public void GetPublicFacingUrlSSLForwarder1() {
103103
HttpRequest req = new HttpRequest("a.aspx", "http://someinternalhost/a.aspx?a=b", "a=b");
104104
var serverVariables = new NameValueCollection();
@@ -112,7 +112,7 @@ public void GetPublicFacingUrlSSLForwarder1() {
112112
/// <summary>
113113
/// Verifies SSL forwarders are correctly handled when they supply X_FORWARDED_PROTO and HOST:port
114114
/// </summary>
115-
[TestCase]
115+
[Test]
116116
public void GetPublicFacingUrlSSLForwarder2() {
117117
HttpRequest req = new HttpRequest("a.aspx", "http://someinternalhost/a.aspx?a=b", "a=b");
118118
var serverVariables = new NameValueCollection();
@@ -126,7 +126,7 @@ public void GetPublicFacingUrlSSLForwarder2() {
126126
/// <summary>
127127
/// Verifies SSL forwarders are correctly handled when they supply just HOST
128128
/// </summary>
129-
[TestCase]
129+
[Test]
130130
public void GetPublicFacingUrlSSLForwarder3() {
131131
HttpRequest req = new HttpRequest("a.aspx", "http://someinternalhost/a.aspx?a=b", "a=b");
132132
var serverVariables = new NameValueCollection();
@@ -139,7 +139,7 @@ public void GetPublicFacingUrlSSLForwarder3() {
139139
/// <summary>
140140
/// Verifies SSL forwarders are correctly handled when they supply just HOST:port
141141
/// </summary>
142-
[TestCase]
142+
[Test]
143143
public void GetPublicFacingUrlSSLForwarder4() {
144144
HttpRequest req = new HttpRequest("a.aspx", "http://someinternalhost/a.aspx?a=b", "a=b");
145145
var serverVariables = new NameValueCollection();

src/DotNetOpenAuth.Test/Messaging/MessageSerializerTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public void SerializeTest() {
5858
/// <summary>
5959
/// Verifies JSON serialization
6060
/// </summary>
61-
[TestCase]
61+
[Test]
6262
public void SerializeDeserializeJson() {
6363
var serializer = MessageSerializer.Get(typeof(Mocks.TestMessage));
6464
var message = GetStandardTestMessage(FieldFill.CompleteBeforeBindings);
@@ -89,7 +89,7 @@ public void DeserializeNull() {
8989
MessageSerializer.Deserialize(null, null);
9090
}
9191

92-
[TestCase]
92+
[Test]
9393
public void DeserializeSimple() {
9494
var serializer = MessageSerializer.Get(typeof(Mocks.TestMessage));
9595
Dictionary<string, string> fields = new Dictionary<string, string>(StringComparer.Ordinal);
@@ -112,7 +112,7 @@ public void DeserializeSimple() {
112112
/// The element sorting rules are first inheritance order, then alphabetical order.
113113
/// This test validates correct behavior on both.
114114
/// </remarks>
115-
[TestCase]
115+
[Test]
116116
public void DeserializeVerifyElementOrdering() {
117117
var serializer = MessageSerializer.Get(typeof(Mocks.TestDerivedMessage));
118118
Dictionary<string, string> fields = new Dictionary<string, string>(StringComparer.Ordinal);
@@ -136,7 +136,7 @@ public void DeserializeVerifyElementOrdering() {
136136
Assert.AreEqual("privateValue", actual.PrivatePropertyAccessor);
137137
}
138138

139-
[TestCase]
139+
[Test]
140140
public void DeserializeWithExtraFields() {
141141
var serializer = MessageSerializer.Get(typeof(Mocks.TestMessage));
142142
Dictionary<string, string> fields = new Dictionary<string, string>(StringComparer.Ordinal);

0 commit comments

Comments
 (0)