public void WhenThereNotIsAGroupWithGivenName_ThenReturnsFalse() { var existGroupByGroupName = new ExistGroupByGroupName(connectionString); groupsCollection.Insert(new Group { Id = Identity.Random(12), Name = "Foo" }); existGroupByGroupName.Execute("Bar").Should().Be.False(); }
public void WhenThereIsAGroupWithSameNameAndIdNull_ThenReturnsTrue() { var existGroupByGroupName = new ExistGroupByGroupName(connectionString); var entity = new Group { Id = Identity.Random(12), Name = "Foo" }; groupsCollection.Insert(entity); existGroupByGroupName.Execute("Foo", null).Should().Be.True(); }
public void WhenThereIsAGroupWithSameNameAndDifferentId_ThenReturnsTrue() { var existGroupByGroupName = new ExistGroupByGroupName(connectionString); var entity = new Group { Id = Identity.Random(12), Name = "Foo" }; groupsCollection.Insert(entity); existGroupByGroupName.Execute("Foo", new Identity("4de7e38617b6c420a45a84c4")).Should().Be.True(); }