public void TestLookupIdGeneratorConventionWithTestClassB() { var convention = new LookupIdGeneratorConvention(); var classMap = new BsonClassMap<TestClassB>(); classMap.MapIdMember(x => x.GuidId); convention.PostProcess(classMap); Assert.IsNotNull(classMap.IdMemberMap.IdGenerator); Assert.IsInstanceOf<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.NotNull(classMap.IdMemberMap.IdGenerator); Assert.IsType<ObjectIdGenerator>(classMap.IdMemberMap.IdGenerator); }