public void ShouldErrorIfTrustManagerNotNull(string scheme) { var uri = new Uri($"{scheme}://localhost/?"); var ex = Record.Exception(() => EncryptionManager.Create(uri, null, new CustomTrustManager(), null)); ex.Should().BeOfType <ArgumentException>(); ex.Message.Should().Contain("cannot both be set via uri scheme and driver configuration"); }
public void ShouldCreateFromConfig(string scheme) { var uri = new Uri($"{scheme}://localhost/?"); var encryption = EncryptionManager.Create(uri, EncryptionLevel.Encrypted, null, null); encryption.UseTls.Should().BeTrue(); encryption.TrustManager.Should().BeOfType <ChainTrustManager>(); }
public void ShouldCreateDefaultWithoutConfig(string scheme) { var uri = new Uri($"{scheme}://localhost/?"); var encryption = EncryptionManager.Create(uri, null, null, null); encryption.UseTls.Should().BeFalse(); encryption.TrustManager.Should().BeNull(); }
public void ShouldCreateInsecureTrustFromUri(string scheme) { var uri = new Uri($"{scheme}://localhost/?"); var encryption = EncryptionManager.Create(uri, null, null, null); encryption.UseTls.Should().BeTrue(); encryption.TrustManager.Should().BeOfType <InsecureTrustManager>(); }