Exemple #1
0
        public void WhenThereIsNotATopicWithGivenName_ThenReturnsFalse()
        {
            var existTopicByTopicName = new ExistTopicByName(connectionString);
            var topic = new Topic {
                Id = Identity.Random(12), Name = "Foo", GroupId = Identity.Random(12)
            };

            topicsCollection.Insert(topic);
            existTopicByTopicName.Execute(topic.GroupId, "Bar").Should().Be.False();
        }
Exemple #2
0
        public void WhenThereIsATopicWithSameNameInDifferentGroup_ThenReturnsFalse()
        {
            var existTopicByTopicName = new ExistTopicByName(connectionString);
            var topic = new Topic {
                Id = Identity.Random(12), Name = "Foo", GroupId = Identity.Random(12)
            };

            topicsCollection.Insert(topic);
            existTopicByTopicName.Execute(Identity.Random(12), "Foo", Identity.Random(12)).Should().Be.False();
        }
Exemple #3
0
        public void WhenThereIsATopicWithSameNameAndIdNull_ThenReturnsTrue()
        {
            var existTopicByTopicName = new ExistTopicByName(connectionString);
            var topic = new Topic {
                Id = Identity.Random(12), Name = "Foo", GroupId = Identity.Random(12)
            };

            topicsCollection.Insert(topic);
            existTopicByTopicName.Execute(topic.GroupId, "Foo", null).Should().Be.True();
        }