Beispiel #1
0
        public void ObjectIdGeneratorOnObjectIdProperty()
        {
            var processor = new EntityIdProcessor();
            var classMap  = new BsonClassMap <ObjectIdGeneratorTestModel>();

            processor.ApplyMapping(typeof(ObjectIdGeneratorTestModel), classMap);

            Assert.AreEqual(typeof(ObjectIdGenerator), classMap.IdMemberMap.IdGenerator?.GetType());
        }
Beispiel #2
0
        public void IdMapsOnAttribute()
        {
            var processor = new EntityIdProcessor();
            var classMap  = new BsonClassMap <IdByAttributeTestModel>();

            processor.ApplyMapping(typeof(IdByAttributeTestModel), classMap);

            var entityMapper = new EntityMapper <IdByAttributeTestModel>();

            Assert.AreEqual("MyCustomId", entityMapper.GetIdName());
        }