summaryrefslogtreecommitdiffstats
path: root/src/DotNetOAuth.Test/Messaging/DictionaryXmlReaderTests.cs
blob: 54c47f07f2a658574ac1009f6cb336238e8d56aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//-----------------------------------------------------------------------
// <copyright file="DictionaryXmlReaderTests.cs" company="Andrew Arnott">
//     Copyright (c) Andrew Arnott. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------

namespace DotNetOAuth.Test.Messaging {
	using System;
	using System.Collections.Generic;
	using System.Xml.Linq;
	using DotNetOAuth.Messaging;
	using Microsoft.VisualStudio.TestTools.UnitTesting;

	[TestClass]
	public class DictionaryXmlReaderTests : TestBase {
		[TestMethod, ExpectedException(typeof(ArgumentNullException))]
		public void CreateWithNullRootElement() {
			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() {
			IComparer<string> fieldSorter = new DataContractMemberComparer(typeof(Mocks.TestMessage));
			DictionaryXmlReader.Create(XName.Get("name", "ns"), fieldSorter, null);
		}
	}
}