예제 #1
0
        public void Test_Clone(string queue, string connection)
        {
            var test  = new BaseConnectionInformation(new QueueConnection(queue, connection));
            var clone = (BaseConnectionInformation)test.Clone();

            Assert.Equal(test.ConnectionString, clone.ConnectionString);
            Assert.Equal(test.QueueName, clone.QueueName);
        }
        public void Test_Clone(string queue, string connection, Dictionary <string, string> settings)
        {
            var test  = new BaseConnectionInformation(new QueueConnection(queue, connection, settings));
            var clone = (BaseConnectionInformation)test.Clone();

            Assert.Equal(test.ConnectionString, clone.ConnectionString);
            Assert.Equal(test.QueueName, clone.QueueName);

            foreach (var setting in settings)
            {
                Assert.Contains(setting.Key, clone.AdditionalConnectionSettings);
            }
        }
        public void Test_Equals(string queue, string connection, Dictionary <string, string> settings, Dictionary <string, string> settings2)
        {
            var test  = new BaseConnectionInformation(new QueueConnection(queue, connection, settings));
            var clone = (BaseConnectionInformation)test.Clone();

            Assert.True(test.Equals(clone));
            Assert.False(test.Equals(null));

            var test2 = new BaseConnectionInformation(new QueueConnection(queue, connection));

            Assert.False(test2.Equals(test));

            var test3 = new BaseConnectionInformation(new QueueConnection(queue, connection, settings2));

            Assert.False(test2.Equals(test));
        }