Exemplo n.º 1
0
        public void TestLookupIdGeneratorConventionWithTestClassB()
        {
            var convention = new LookupIdGeneratorConvention();
            var classMap   = new BsonClassMap <TestClassB>();

            classMap.MapIdMember(x => x.GuidId);
            convention.PostProcess(classMap);
            Assert.NotNull(classMap.IdMemberMap.IdGenerator);
            Assert.IsType <GuidGenerator>(classMap.IdMemberMap.IdGenerator);
        }
        public void TestLookupIdGeneratorConventionWithTestClassA()
        {
            var convention = new LookupIdGeneratorConvention();
            var classMap   = new BsonClassMap <TestClassA>();

            classMap.MapIdMember(x => x.ObjectId);
            convention.PostProcess(classMap);
            Assert.IsNotNull(classMap.IdMemberMap.IdGenerator);
            Assert.IsInstanceOf <ObjectIdGenerator>(classMap.IdMemberMap.IdGenerator);
        }