Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 2
0
        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");
        }
Ejemplo n.º 3
0
        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();
        }
Ejemplo n.º 4
0
        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();
        }
Ejemplo n.º 5
0
        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");
        }
Ejemplo n.º 6
0
        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();
        }