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); }
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); }