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); }
public void TestLookupIdGeneratorConvention() { var convention = new LookupIdGeneratorConvention(); var guidProperty = typeof(TestClass).GetProperty("GuidId"); var objectIdProperty = typeof(TestClass).GetProperty("ObjectId"); Assert.IsInstanceOf<GuidGenerator>(convention.GetIdGenerator(guidProperty)); Assert.IsInstanceOf<ObjectIdGenerator>(convention.GetIdGenerator(objectIdProperty)); }