예제 #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();
        }
예제 #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();
        }
예제 #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();
        }