public void KeyVaultConnectionString_can_construct_with_any_string_successfully(string connectionString, bool validates, string url, string clientId, string clientSecret, string keyName, string keyVersion, string algorithm) { // Act var result = new KeyVaultConnectionString(connectionString); var success = true; try { result.Validate(); } catch (Exception e) { success = false; } // Assert result.ShouldNotBeNull(); success.ShouldBe(validates); result.Url.ShouldBe(url); result.ClientId.ShouldBe(clientId); result.ClientSecret.ShouldBe(clientSecret); result.KeyName.ShouldBe(keyName); result.KeyVersion.ShouldBe(keyVersion); result.Algorithm.ShouldBe(algorithm); result.HasKeyName.ShouldBe(!string.IsNullOrWhiteSpace(keyName)); result.HasKeyVersion.ShouldBe(!string.IsNullOrWhiteSpace(keyVersion)); }
public void KeyVaultConnectionString_can_construct_with_any_string_but_fails_validation(string connectionString) { // Act var result = new KeyVaultConnectionString(connectionString); var ex = Assert.Throws <ArgumentException>( () => result.Validate() ); // Assert result.ShouldNotBeNull(); ex.ShouldNotBeNull(); }