public void ShouldSearchForIssuerUsingCaseInsensitiveName()
        {
            XmlPolicyStore store = new XmlPolicyStore(TestContext.CurrentContext.TestDirectory + @"..\..\..\content\claimMappings-PassingTest1.xml", new FileXmlRepository());

            var issuer = store.RetrieveIssuer(new Uri("http://localhost/1"), "myissuer1");

            Assert.IsNotNull(issuer);
            Assert.AreEqual("myIssuer1", issuer.DisplayName);

            issuer = store.RetrieveIssuer(new Uri("http://localhost/1"), "MYISSUER1");
            Assert.IsNotNull(issuer);
            Assert.AreEqual("myIssuer1", issuer.DisplayName);
        }
        public void ShouldNotRetrieveIssuersFromOtherScopes()
        {
            XmlPolicyStore store = new XmlPolicyStore(TestContext.CurrentContext.TestDirectory + @"..\..\..\content\claimMappings-PassingTest1.xml", new FileXmlRepository());

            var issuer = store.RetrieveIssuer(new Uri("http://localhost/1"), "myIssuer3");

            Assert.IsNull(issuer);
        }
        public void ShouldRetrieveNullIfIssuerDoesNotExists()
        {
            XmlPolicyStore store = new XmlPolicyStore(TestContext.CurrentContext.TestDirectory + @"..\..\..\content\claimMappings-PassingTest1.xml", new FileXmlRepository());

            var issuer = store.RetrieveIssuer(new Uri("http://localhost/1"), "Inexisting Issuer");

            Assert.IsNull(issuer);
        }
        public void ShouldRetrieveExistingIssuerByDisplayName()
        {
            XmlPolicyStore store = new XmlPolicyStore(@".\content\claimMappings-PassingTest1.xml", new FileXmlRepository());

            var issuer = store.RetrieveIssuer(new Uri("http://localhost/1"), "myIssuer1");

            Assert.IsNotNull(issuer);
            Assert.AreEqual("myIssuer1", issuer.DisplayName);
        }
        public void ShouldThrowIfScopeNotFoundOnIssuerRetrieval()
        {
            XmlPolicyStore store = new XmlPolicyStore(TestContext.CurrentContext.TestDirectory + @"..\..\..\content\claimMappings-PassingTest1.xml", new FileXmlRepository());

            Assert.Throws <PolicyScopeException>(() => store.RetrieveIssuer(new Uri("http://inexistentScope/"), "myIssuer1"));
        }
        public void ShouldThrowIfScopeNotFoundOnIssuerRetrieval()
        {
            XmlPolicyStore store = new XmlPolicyStore(@".\content\claimMappings-PassingTest1.xml", new FileXmlRepository());

            store.RetrieveIssuer(new Uri("http://inexistentScope/"), "myIssuer1");
        }