public void PendingAuthnInMemoryStorage_Remove_FalseOnIdNeverIssued()
 {
     var id = new Saml2Id();
     StoredRequestState responseData;
     var container = new PendingAuthnInMemoryStorage();
     container.TryRemove(id, out responseData).Should().BeFalse();
 }
 public void PendingAuthnRequest_TryRemove_NullGivesNull()
 {
     Saml2Id id = null;
     StoredRequestState state;
     var container = new PendingAuthnInMemoryStorage();
     container.TryRemove(id, out state).Should().BeFalse();
     state.Should().BeNull();
 }
 public void PendingAuthnInMemoryStorage_Add_ThrowsOnExisting()
 {
     var id = new Saml2Id();
     var requestData = new StoredRequestState(new EntityId("testidp"), new Uri("http://localhost/Return.aspx"));
     var container = new PendingAuthnInMemoryStorage();
     container.Add(id, requestData);
     Action a = () => container.Add(id, requestData);
     a.ShouldThrow<InvalidOperationException>();
 }
 public void PendingAuthnInMemoryStorage_Remove_FalseOnRemovedTwice()
 {
     var id = new Saml2Id();
     var requestData = new StoredRequestState(new EntityId("testidp"), new Uri("http://localhost/Return.aspx"));
     StoredRequestState responseData;
     var container = new PendingAuthnInMemoryStorage();
     container.Add(id, requestData);
     container.TryRemove(id, out responseData).Should().BeTrue();
     container.TryRemove(id, out responseData).Should().BeFalse();
 }