コード例 #1
0
        public void Parse_Where_Entry_For_This_Machine_Exists_Results_In_Parse_Result()
        {
            var _password        = "******";
            var _passwordCipher  = new DefaultPasswordParser().Encrypt(_password);
            var _passwordSetting = string.Format("{0}:{1}", Environment.MachineName, _passwordCipher);

            var _result = this.c_SUT.Parse(_passwordSetting);

            Assert.IsNotNull(_password, _result);
        }
コード例 #2
0
        public void Parse_Where_Single_Host_With_Encrypted_Password_Results_In_A_Single_Connection_String()
        {
            var _passwordCipher           = new DefaultPasswordParser().Encrypt("ThePassword");
            var _connectionStringSettings = string.Format("hosts=localhost;port=5672;virtualhost=/;username=guest;ispasswordencrypted=true;password={0}:{1}", Environment.MachineName, _passwordCipher);

            var _result = this.c_SUT.Parse(_connectionStringSettings);

            Assert.IsNotNull(_result);
            Assert.AreEqual(1, _result.Count());
            Assert.AreEqual("amqp://*****:*****@localhost:5672/", _result.First());
        }
コード例 #3
0
        public void Parse_Where_Multiple_Hosts_With_Encryped_Passwords_Results_In_A_Multiple_Connection_Strings()
        {
            var _passwordCipher           = new DefaultPasswordParser().Encrypt("ThePassword");
            var _connectionStringSettings = string.Format("hosts=host1,host2;port=5;virtualhost=/dev;username=ted;ispasswordencrypted=true;password=M1:encryptedpassword,{0}:{1}", Environment.MachineName, _passwordCipher);

            var _result = this.c_SUT.Parse(_connectionStringSettings);

            Assert.IsNotNull(_result);
            Assert.AreEqual(2, _result.Count());
            Assert.AreEqual("amqp://*****:*****@host1:5/dev", _result.First());
            Assert.AreEqual("amqp://*****:*****@host2:5/dev", _result.Skip(1).First());
        }
コード例 #4
0
        public void Parse_Where_Multiple_Entries_Including_One_For_This_Machine_Exists_Results_In_Parse_Result()
        {
            var _thisMachinesPassword       = "******";
            var _otherPassword              = "******";
            var _thisMachinesPasswordCipher = new DefaultPasswordParser().Encrypt(_thisMachinesPassword);
            var _otherPasswordCipher        = new DefaultPasswordParser().Encrypt(_otherPassword);

            var _passwordSetting = string.Format("Machine1:{0},{1}:{2},Machine3:{0}", _otherPasswordCipher, Environment.MachineName, _thisMachinesPasswordCipher);

            var _result = this.c_SUT.Parse(_passwordSetting);

            Assert.IsNotNull(_thisMachinesPassword, _result);
        }