public void WhenIdExist_ThenReturnsTrue() { var existEntityById = new EntityById(connectionString); var entity = new Group { Name = "Foo" }; mongoDb.GetCollection(MongoDbConstants.Collections.Groups) .Insert(entity); existEntityById.Exist<Group>(entity.Id.Value) .Should().Be.True(); }
public void WhenEntityExist_ThenGetReturnsEntity() { var existEntityById = new EntityById(connectionString); var entity = new Group { Name = "Foo" }; mongoDb.GetCollection(MongoDbConstants.Collections.Groups) .Insert(entity); existEntityById.Get<Group>(entity.Id.Value) .Satisfy(e => e != null && e.Name == "Foo"); }
public void WhenDoesNotIdExist_ThenReturnsFalse() { var existEntityById = new EntityById(connectionString); var entity = new Group { Name = "Foo" }; mongoDb.GetCollection(MongoDbConstants.Collections.Groups) .Insert(entity); existEntityById.Exist<Group>(new Identity("4de7e38617b6c420a45a84c4")) .Should().Be.False(); }
public void WhenDoesNotIdExist_ThenReturnsFalse() { var existEntityById = new EntityById(connectionString); var entity = new Group { Name = "Foo" }; mongoDb.GetCollection(MongoDbConstants.Collections.Groups) .Insert(entity); existEntityById.Exist <Group>(new Identity("4de7e38617b6c420a45a84c4")) .Should().Be.False(); }
public void WhenEntityExist_ThenGetReturnsEntity() { var existEntityById = new EntityById(connectionString); var entity = new Group { Name = "Foo" }; mongoDb.GetCollection(MongoDbConstants.Collections.Groups) .Insert(entity); existEntityById.Get <Group>(entity.Id.Value) .Satisfy(e => e != null && e.Name == "Foo"); }
public void WhenIdExist_ThenReturnsTrue() { var existEntityById = new EntityById(connectionString); var entity = new Group { Name = "Foo" }; mongoDb.GetCollection(MongoDbConstants.Collections.Groups) .Insert(entity); existEntityById.Exist <Group>(entity.Id.Value) .Should().Be.True(); }