Exemplo n.º 1
0
        public void Create_IfMalformedPattern_PropagatesThrownException()
        {
            const string queueNamePattern = "malformed-queue-{name%";

            Assert.Throws <FormatException>(
                () => BindableServiceBusPath.Create(queueNamePattern),
                "Invalid template 'malformed-queue-{name%'. Missing closing bracket at position 17.");
        }
Exemplo n.º 2
0
        public void Create_IfParameterizedPattern_ReturnsNotBoundPath()
        {
            const string queueOrTopicNamePattern = "queue-{name}-with-{parameter}";

            IBindableServiceBusPath path = BindableServiceBusPath.Create(queueOrTopicNamePattern);

            Assert.NotNull(path);
            Assert.AreEqual(queueOrTopicNamePattern, path.QueueOrTopicNamePattern);
            Assert.False(path.IsBound);
        }
Exemplo n.º 3
0
        public void Create_IfNonParameterizedPattern_ReturnsBoundPath()
        {
            const string queueOrTopicNamePattern = "queue-name-with-no-parameters";

            IBindableServiceBusPath path = BindableServiceBusPath.Create(queueOrTopicNamePattern);

            Assert.NotNull(path);
            Assert.AreEqual(queueOrTopicNamePattern, path.QueueOrTopicNamePattern);
            Assert.True(path.IsBound);
        }
Exemplo n.º 4
0
 public void Create_IfNullPattern_Throws()
 {
     Assert.Throws <ArgumentNullException>(() => BindableServiceBusPath.Create(null), "queueOrTopicNamePattern");
 }