Example #1
0
        public void Cloud_BasicCredentialsTest()
        {
            CredentialsBase credentials       = new BasicCredentials("user", "pass");
            var             credentialDetails = new CredentialDetails(credentials, PrivacyLevel.None, EncryptedConnection.Encrypted);

            Assert.IsNotNull(credentialDetails);
            Assert.AreEqual("{\"credentialData\":[{\"name\":\"username\",\"value\":\"user\"},{\"name\":\"password\",\"value\":\"pass\"}]}", credentialDetails.Credentials);
            Assert.AreEqual(CredentialType.Basic, credentialDetails.CredentialType);
            Assert.AreEqual(EncryptedConnection.Encrypted, credentialDetails.EncryptedConnection);
            Assert.AreEqual(EncryptionAlgorithm.None, credentialDetails.EncryptionAlgorithm);
            Assert.AreEqual(PrivacyLevel.None, credentialDetails.PrivacyLevel);
            Assert.AreEqual(false, credentialDetails.UseCallerAADIdentity);
        }
Example #2
0
        public void OnPrem_BasicCredentialsTest()
        {
            CredentialsBase credentials          = new BasicCredentials("user", "pass");
            var             credentialsEncryptor = new AsymmetricKeyEncryptor(publicKey);

            var credentialDetails = new CredentialDetails(credentials, PrivacyLevel.None, EncryptedConnection.Encrypted, credentialsEncryptor);

            Assert.IsNotNull(credentialDetails);
            Assert.IsNotNull(credentialDetails.Credentials);
            Assert.AreEqual(CredentialType.Basic, credentialDetails.CredentialType);
            Assert.AreEqual(EncryptedConnection.Encrypted, credentialDetails.EncryptedConnection);
            Assert.AreEqual(EncryptionAlgorithm.RSAOAEP, credentialDetails.EncryptionAlgorithm);
            Assert.AreEqual(PrivacyLevel.None, credentialDetails.PrivacyLevel);
            Assert.AreEqual(false, credentialDetails.UseCallerAADIdentity);
        }