Esempio n. 1
0
        public void TestEmptyPasswordParameterException() {
            IConfigCommand command = new ConfigCommand() {
                Command = new Command() {
                    CommandType = CommandType.ConnectionQuery
                }
            };

            command.Encrypt("");
        }
Esempio n. 2
0
        public void TestCommandNulledAfterEncryption() {
            IConfigCommand command = new ConfigCommand() {
                Command = new Command() {
                    CommandType = CommandType.ConnectionQuery
                }
            };

            command.Encrypt(TestEncrypt.Password);

            Assert.IsNull(command.Command);
        }
Esempio n. 3
0
        public void TestEncryptedCanBeDecryptedInMemory() {
            IConfigCommand command = new ConfigCommand() {
                Command = new Command() {
                    CommandType = CommandType.ConnectionQuery
                }
            };

            command.Encrypt(TestEncrypt.Password);

            Assert.IsNull(command.Command);

            command.Decrypt(TestEncrypt.Password);

            Assert.IsNotNull(command.Command);
        }
Esempio n. 4
0
        public void TestEncryptedCanBeDecryptedInMemoryIntegrityWithComplexPassword() {
            const string password = "******";

            IConfigCommand command = new ConfigCommand() {
                Command = new Command() {
                    CommandType = CommandType.ConnectionQuery
                }
            };

            command.Encrypt(password);

            Assert.IsNull(command.Command);

            command.Decrypt(password);

            Assert.AreEqual(CommandType.ConnectionQuery.ToString(), command.Command.Name);
        }
Esempio n. 5
0
        public void TestEncryptedCanBeDecryptedInMemoryIntegrity() {
            IConfigCommand command = new ConfigCommand() {
                Command = new Command() {
                    CommandType = CommandType.ConnectionQuery
                }
            };

            command.Encrypt(TestEncrypt.Password);

            Assert.IsNull(command.Command);

            command.Decrypt(TestEncrypt.Password);

            Assert.AreEqual(CommandType.ConnectionQuery.ToString(), command.Command.Name);
        }