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