diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2008-09-18 22:54:10 -0700 |
---|---|---|
committer | Andrew <andrewarnott@gmail.com> | 2008-09-18 22:54:10 -0700 |
commit | 4b6f60f351b8520e3824ee80dc0066f1c69c29b4 (patch) | |
tree | b541a53615096c49d2f4988e68622a10b50ff412 /src/DotNetOAuth.Test/Messaging/Reflection/MessagePartTests.cs | |
parent | 11615a19bad90741c7a755eaf741b8683992c9ff (diff) | |
download | DotNetOpenAuth-4b6f60f351b8520e3824ee80dc0066f1c69c29b4.zip DotNetOpenAuth-4b6f60f351b8520e3824ee80dc0066f1c69c29b4.tar.gz DotNetOpenAuth-4b6f60f351b8520e3824ee80dc0066f1c69c29b4.tar.bz2 |
All tests passing, with more work done.
Diffstat (limited to 'src/DotNetOAuth.Test/Messaging/Reflection/MessagePartTests.cs')
-rw-r--r-- | src/DotNetOAuth.Test/Messaging/Reflection/MessagePartTests.cs | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/DotNetOAuth.Test/Messaging/Reflection/MessagePartTests.cs b/src/DotNetOAuth.Test/Messaging/Reflection/MessagePartTests.cs index 1d7e1b8..bfc8192 100644 --- a/src/DotNetOAuth.Test/Messaging/Reflection/MessagePartTests.cs +++ b/src/DotNetOAuth.Test/Messaging/Reflection/MessagePartTests.cs @@ -14,16 +14,23 @@ namespace DotNetOAuth.Test.Messaging.Reflection { /// Optional structs like int must be nullable for Optional to make sense.
/// </summary>
[MessagePart(IsRequired = false)]
- internal int optionalInt;
+ internal int optionalInt = 0;
+ }
+ class MessageWithNonNullableRequiredStruct {
+ /// <summary>
+ /// This should work because a required field will always have a value so it
+ /// need not be nullable.
+ /// </summary>
+ [MessagePart(IsRequired = true)]
+ internal int optionalInt = 0;
}
class MessageWithNullableOptionalStruct {
/// <summary>
/// Optional structs like int must be nullable for Optional to make sense.
/// </summary>
[MessagePart(IsRequired = false)]
- internal int? optionalInt;
+ internal int? optionalInt = 0;
}
-
[TestMethod, ExpectedException(typeof(ArgumentException))]
public void OptionalNonNullableStruct() {
@@ -31,6 +38,11 @@ namespace DotNetOAuth.Test.Messaging.Reflection { }
[TestMethod]
+ public void RequiredNonNullableStruct() {
+ ParameterizedMessageTypeTest(typeof(MessageWithNonNullableRequiredStruct));
+ }
+
+ [TestMethod]
public void OptionalNullableStruct() {
ParameterizedMessageTypeTest(typeof(MessageWithNullableOptionalStruct));
}
|