Esempio n. 1
0
            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");
            }
Esempio n. 2
0
            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>();
            }
Esempio n. 3
0
            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>();
            }