Пример #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();
        }
Пример #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");
        }
Пример #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();
        }
Пример #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();
        }
Пример #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");
        }
Пример #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();
        }