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