summaryrefslogtreecommitdiffstats
path: root/src/DotNetOAuth.Test/Messaging/DictionaryXmlReaderTests.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2008-09-13 07:07:36 -0700
committerAndrew <andrewarnott@gmail.com>2008-09-13 07:07:36 -0700
commit9b189b9a943f18c17c7b468dd9e60c65f7edc7dc (patch)
treea58300f624663948b3053045167cadd06c293c2d /src/DotNetOAuth.Test/Messaging/DictionaryXmlReaderTests.cs
parent6c4936e194080e6a7d2194870cf57814d6432eff (diff)
downloadDotNetOpenAuth-9b189b9a943f18c17c7b468dd9e60c65f7edc7dc.zip
DotNetOpenAuth-9b189b9a943f18c17c7b468dd9e60c65f7edc7dc.tar.gz
DotNetOpenAuth-9b189b9a943f18c17c7b468dd9e60c65f7edc7dc.tar.bz2
Fixed xml spoofing bug for using DataContractSerializer to deserialize messages.
Added tests to verify correct behavior.
Diffstat (limited to 'src/DotNetOAuth.Test/Messaging/DictionaryXmlReaderTests.cs')
-rw-r--r--src/DotNetOAuth.Test/Messaging/DictionaryXmlReaderTests.cs11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/DotNetOAuth.Test/Messaging/DictionaryXmlReaderTests.cs b/src/DotNetOAuth.Test/Messaging/DictionaryXmlReaderTests.cs
index 3dc3238..54c47f0 100644
--- a/src/DotNetOAuth.Test/Messaging/DictionaryXmlReaderTests.cs
+++ b/src/DotNetOAuth.Test/Messaging/DictionaryXmlReaderTests.cs
@@ -15,12 +15,19 @@ namespace DotNetOAuth.Test.Messaging {
public class DictionaryXmlReaderTests : TestBase {
[TestMethod, ExpectedException(typeof(ArgumentNullException))]
public void CreateWithNullRootElement() {
- DictionaryXmlReader.Create(null, new Dictionary<string, string>());
+ IComparer<string> fieldSorter = new DataContractMemberComparer(typeof(Mocks.TestMessage));
+ DictionaryXmlReader.Create(null, fieldSorter, new Dictionary<string, string>());
+ }
+
+ [TestMethod, ExpectedException(typeof(ArgumentNullException))]
+ public void CreateWithNullDataContractType() {
+ DictionaryXmlReader.Create(XName.Get("name", "ns"), null, new Dictionary<string, string>());
}
[TestMethod, ExpectedException(typeof(ArgumentNullException))]
public void CreateWithNullFields() {
- DictionaryXmlReader.Create(XName.Get("name", "ns"), null);
+ IComparer<string> fieldSorter = new DataContractMemberComparer(typeof(Mocks.TestMessage));
+ DictionaryXmlReader.Create(XName.Get("name", "ns"), fieldSorter, null);
}
}
}