Beispiel #1
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);
        }
Beispiel #2
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);
        }
Beispiel #3
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);
        }