This repository has been archived by the owner on Mar 20, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 732
/
OpenIdRelyingPartyTest.cs
54 lines (47 loc) · 1.68 KB
/
OpenIdRelyingPartyTest.cs
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
using System;
using System.Collections.Generic;
using System.Text;
using NUnit.Framework;
using DotNetOpenId.RelyingParty;
using System.Collections.Specialized;
using System.Web;
using System.Net;
namespace DotNetOpenId.Test.RelyingParty {
[TestFixture]
public class OpenIdRelyingPartyTest {
IRelyingPartyApplicationStore store;
UriIdentifier simpleOpenId = new UriIdentifier("http://nonexistant.openid.com");
Realm simpleRealm = new Realm("http://consumertest.openid.com");
Uri simpleReturnTo = new Uri("http://consumertest.openid.com/consumertests");
[SetUp]
public void Setup() {
store = new ConsumerApplicationMemoryStore();
}
[Test]
[ExpectedException(typeof(InvalidOperationException))]
public void DefaultCtorWithoutContext() {
new OpenIdRelyingParty();
}
[Test]
public void CtorWithNullRequestUri() {
new OpenIdRelyingParty(store, null);
}
[Test]
[ExpectedException(typeof(NotSupportedException), UserMessage = "Until this is a supported scenario, an exception should be thrown right away.")]
public void CtorWithNullStore() {
var consumer = new OpenIdRelyingParty(null, new Uri("http://localhost/hi"));
}
[Test]
[ExpectedException(typeof(InvalidOperationException))]
public void CreateRequestWithoutContext1() {
var consumer = new OpenIdRelyingParty(store, new Uri("http://localhost/hi"));
consumer.CreateRequest(simpleOpenId);
}
[Test]
[ExpectedException(typeof(InvalidOperationException))]
public void CreateRequestWithoutContext2() {
var consumer = new OpenIdRelyingParty(store, new Uri("http://localhost/hi"));
consumer.CreateRequest(simpleOpenId, simpleRealm);
}
}
}