summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenId.Test/Extensions/AttributeExchangeFetchResponseTests.cs
blob: df10ea61b54fb2c38a57bac36b419a0bc5269edf (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
34
35
36
37
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using DotNetOpenId.Extensions.AttributeExchange;

namespace DotNetOpenId.Test.Extensions {
	[TestFixture]
	public class AttributeExchangeFetchResponseTests {
		[Test]
		public void AddAttribute() {
			var response = new FetchResponse();
			response.AddAttribute(new AttributeValues("http://someattribute", "Value1"));
		}

		[Test]
		public void AddTwoAttributes() {
			var response = new FetchResponse();
			response.AddAttribute(new AttributeValues("http://someattribute", "Value1"));
			response.AddAttribute(new AttributeValues("http://someOtherAttribute", "Value2"));
		}

		[Test, ExpectedException(typeof(ArgumentException))]
		public void AddAttributeTwice() {
			var response = new FetchResponse();
			response.AddAttribute(new AttributeValues("http://someattribute", "Value1"));
			response.AddAttribute(new AttributeValues("http://someattribute", "Value1"));
		}

		[Test, ExpectedException(typeof(ArgumentNullException))]
		public void AddAttributeNull() {
			var response = new FetchResponse();
			response.AddAttribute(null);
		}
	}
}