diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2008-09-10 08:17:28 -0700 |
---|---|---|
committer | Andrew <andrewarnott@gmail.com> | 2008-09-10 08:17:28 -0700 |
commit | 51070c061fc7eaa15d9281878da9400dd0260b59 (patch) | |
tree | b5ef4752bd9e2fa0cf4a99cd833c81b8beffde18 /src/DotNetOAuth/Messaging/DictionaryXmlReader.cs | |
parent | 32ac38940a40a70c171eedc72b4aacdbba692279 (diff) | |
download | DotNetOpenAuth-51070c061fc7eaa15d9281878da9400dd0260b59.zip DotNetOpenAuth-51070c061fc7eaa15d9281878da9400dd0260b59.tar.gz DotNetOpenAuth-51070c061fc7eaa15d9281878da9400dd0260b59.tar.bz2 |
Much better test coverage.
Diffstat (limited to 'src/DotNetOAuth/Messaging/DictionaryXmlReader.cs')
-rw-r--r-- | src/DotNetOAuth/Messaging/DictionaryXmlReader.cs | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/DotNetOAuth/Messaging/DictionaryXmlReader.cs b/src/DotNetOAuth/Messaging/DictionaryXmlReader.cs index 7a5dc21..6ecc41e 100644 --- a/src/DotNetOAuth/Messaging/DictionaryXmlReader.cs +++ b/src/DotNetOAuth/Messaging/DictionaryXmlReader.cs @@ -41,9 +41,8 @@ namespace DotNetOAuth.Messaging { /// <param name="fields">The dictionary to list values from.</param>
/// <returns>The generated <see cref="XmlReader"/>.</returns>
private static XmlReader CreateRoundtripReader(XName rootElement, IDictionary<string, string> fields) {
- if (rootElement == null) {
- throw new ArgumentNullException("rootElement");
- }
+ Debug.Assert(rootElement != null, "rootElement == null");
+ Debug.Assert(fields != null, "fields == null");
MemoryStream stream = new MemoryStream();
XmlWriter writer = XmlWriter.Create(stream);
@@ -66,15 +65,9 @@ namespace DotNetOAuth.Messaging { /// <param name="rootElement">The name of the root element to use to surround the dictionary values.</param>
/// <param name="fields">The dictionary with values to serialize.</param>
private static void SerializeDictionaryToXml(XmlWriter writer, XName rootElement, IDictionary<string, string> fields) {
- if (writer == null) {
- throw new ArgumentNullException("writer");
- }
- if (rootElement == null) {
- throw new ArgumentNullException("rootElement");
- }
- if (fields == null) {
- throw new ArgumentNullException("fields");
- }
+ Debug.Assert(writer != null, "writer == null");
+ Debug.Assert(rootElement != null, "rootElement == null");
+ Debug.Assert(fields != null, "fields == null");
writer.WriteStartElement(rootElement.LocalName, rootElement.NamespaceName);
|