Esempio n. 1
0
        public void Should_return_true_if_input_follows_namespace_name_rules(string value)
        {
            var @namespace = string.Format(Template, value, "RootManageSharedAccessKey", "YourSecret");

            var isValid = ConnectionStringInternal.TryParse(@namespace, out var connectionString);

            Assert.True(isValid);
            Assert.NotNull(connectionString);
        }
Esempio n. 2
0
        public void Should_return_false_if_input_contains_not_valid_chars(string value)
        {
            var @namespace = string.Format(Template, value, "RootManageSharedAccessKey", "YourSecret");

            var isValid = ConnectionStringInternal.TryParse(@namespace, out var connectionString);

            Assert.IsFalse(isValid);
            Assert.Null(connectionString);
        }
Esempio n. 3
0
        public void Should_return_false_if_input_does_not_finish_with_a_letter_or_a_number()
        {
            var @namespace = string.Format(Template, "abcdef-", "RootManageSharedAccessKey", "YourSecret");

            var isValid = ConnectionStringInternal.TryParse(@namespace, out var connectionString);

            Assert.IsFalse(isValid);
            Assert.Null(connectionString);
        }
Esempio n. 4
0
        public void Should_not_equal_on_absence_of_sas_in_one()
        {
            ConnectionStringInternal.TryParse("Endpoint=sb://namespacename.servicebus.windows.net", out var connectionString1);
            ConnectionStringInternal.TryParse("Endpoint=sb://namespacename.servicebus.windows.net;SharedAccessKeyName=name;SharedAccessKey=key", out var connectionString2);

            var areEqual = connectionString1.Equals(connectionString2);

            Assert.IsFalse(areEqual);
        }
Esempio n. 5
0
        public void Should_equal_on_absence_of_sas_in_both()
        {
            ConnectionStringInternal.TryParse("Endpoint=sb://namespacename.servicebus.windows.net", out var connectionString1);
            ConnectionStringInternal.TryParse("Endpoint=sb://namespacename.servicebus.windows.net", out var connectionString2);

            var areEqual = connectionString1.Equals(connectionString2);

            Assert.IsTrue(areEqual);
        }
Esempio n. 6
0
        public void Should_be_able_to_parse_various_domain_names(string connectionStringString)
        {
            ConnectionStringInternal.TryParse(connectionStringString, out var connectionString);

            Assert.AreEqual("namespacename", connectionString.NamespaceName);
        }