public void ThenRepositoryFailsToGetCertificate_IfKeyInfoIsNull() { // Arrange var sut = new KeyInfoRepository(keyInfo: null); // Act X509Certificate2 actualCertificate = sut.GetCertificate(); // Assert Assert.Null(actualCertificate); }
public void ThenRepositoryFailsToGetCertificate_IfKeyInfoHasntAnyClauses() { // Arrange var sut = new KeyInfoRepository(new KeyInfo()); // Act X509Certificate2 actualCertificate = sut.GetCertificate(); // Assert Assert.Null(actualCertificate); }
public void ThenRepositoryFailsToGetCertificate_IfSecurityTokenReferenceHasntAnyCertificate() { // Arrange var keyInfo = new KeyInfo(); keyInfo.AddClause(new BinarySecurityTokenReference(certificate: null)); var repository = new KeyInfoRepository(keyInfo); // Act X509Certificate2 actualCertificate = repository.GetCertificate(); // Assert Assert.Null(actualCertificate); }
public void ThenRepositoryGetsCertificate_IfKeyInfoHasEmbeddedCertificate() { // Arrange var expectedCertificate = new X509Certificate2(); KeyInfo keyInfo = CreateKeyInfoWithEmbeddedCertificate(expectedCertificate); var sut = new KeyInfoRepository(keyInfo); // Act X509Certificate2 actualCertificate = sut.GetCertificate(); // Assert Assert.Equal(expectedCertificate, actualCertificate); }