Exemplo n.º 1
0
        public void ObeysExtraElementsAttribute()
        {
            var processor = new ExtraElementsProcessor();
            var classMap  = new BsonClassMap <ExtraElementsModel>();

            classMap.AutoMap();
            processor.ApplyMapping(typeof(ExtraElementsModel), classMap);

            Assert.AreEqual("AdditionalElements", classMap.ExtraElementsMemberMap?.ElementName);
        }
Exemplo n.º 2
0
        public void ObeysIgnoreExtraElementsAttribute()
        {
            var processor = new ExtraElementsProcessor();
            var classMap  = new BsonClassMap <IgnoreExtraElementsModel>();

            classMap.AutoMap();
            processor.ApplyMapping(typeof(IgnoreExtraElementsModel), classMap);

            Assert.IsTrue(classMap.IgnoreExtraElements);
        }