public static void AddAssertionGrantType_DuplicatesThrow() { const string GrantType = "SomeGrantType"; var options = new AssertionGrantOptions(); options.AddAssertionGrantType <MockAssertionGrantHandler1>(GrantType); Assert.Throws <InvalidOperationException>(() => options.AddAssertionGrantType <MockAssertionGrantHandler2>(GrantType)); Assert.Throws <InvalidOperationException>(() => options.AddAssertionGrantType <MockAssertionGrantHandler3>(GrantType)); Assert.Equal(1, options.AssertionGrantTypeMap.Count); Assert.Equal(typeof(MockAssertionGrantHandler1), options.AssertionGrantTypeMap[GrantType]); }
public static void AddAssertionGrantType_Multiple() { const string GrantType1 = "SomeGrantType1"; const string GrantType2 = "SomeGrantType2"; const string GrantType3 = "SomeGrantType3"; var options = new AssertionGrantOptions(); options.AddAssertionGrantType <MockAssertionGrantHandler1>(GrantType1); options.AddAssertionGrantType <MockAssertionGrantHandler2>(GrantType2); options.AddAssertionGrantType <MockAssertionGrantHandler3>(GrantType3); Assert.Equal(3, options.AssertionGrantTypeMap.Count); Assert.Equal(typeof(MockAssertionGrantHandler1), options.AssertionGrantTypeMap[GrantType1]); Assert.Equal(typeof(MockAssertionGrantHandler2), options.AssertionGrantTypeMap[GrantType2]); Assert.Equal(typeof(MockAssertionGrantHandler3), options.AssertionGrantTypeMap[GrantType3]); }
public static void AddAssertionGrantType_NullGrantTypeThrows() { var options = new AssertionGrantOptions(); Assert.Throws <ArgumentNullException>(() => options.AddAssertionGrantType <MockAssertionGrantHandler1>(null)); Assert.Equal(0, options.AssertionGrantTypeMap.Count); }
public static void AddAssertionGrantType_AddsToCollection() { const string GrantType = "SomeGrantType"; var options = new AssertionGrantOptions(); options.AddAssertionGrantType <MockAssertionGrantHandler1>(GrantType); Assert.Equal(1, options.AssertionGrantTypeMap.Count); Assert.Equal(typeof(MockAssertionGrantHandler1), options.AssertionGrantTypeMap[GrantType]); }