コード例 #1
0
            public void GivenNoCertificatesInHubAndRequiredTrue_ItThrowsConfigurationException()
            {
                // Arrange
                var certs = new Mock<CertificatesHub>() { CallBase = false };
                var azure = new AzureHub(certs.Object);

                // Act/Assert
                var ex = Assert.Throws<ConfigurationException>(() => azure.GetCredentials(throwIfMissing: true));
                Assert.Equal(Strings.AzureHub_MissingCertificate, ex.Message);
            }
コード例 #2
0
            public void GivenNoCertificatesInHubAndRequiredFalse_ItReturnsNullCredentials()
            {
                // Arrange
                var certs = new Mock<CertificatesHub>() { CallBase = false };
                var azure = new AzureHub(certs.Object);

                // Act
                var creds = azure.GetCredentials(throwIfMissing: false);

                // Assert
                Assert.Null(creds);
            }