Ejemplo n.º 1
0
        public void ShouldAssignTheTypeOfDerivedProperties()
        {
            var entity5 = new IDocumentWithPropertyTypeOverride5();
            var type5   = EntityToBlittable.GetPropertyType(nameof(entity5.Reference), entity5.GetType());

            Assert.Equal(typeof(IRefDerived_Class), type5);


            var entity4 = new DocumentWithPropertyTypeOverride4();
            var type4   = EntityToBlittable.GetPropertyType(nameof(entity4.Reference), entity4.GetType());

            Assert.Equal(typeof(RefDerived3), type4);

            var entity3 = new DocumentWithPropertyTypeOverride3();
            var type3   = EntityToBlittable.GetPropertyType(nameof(entity3.Reference), entity3.GetType());

            Assert.Equal(typeof(RefDerived3), type3);

            var entity2 = new DocumentWithPropertyTypeOverride2();
            var type2   = EntityToBlittable.GetPropertyType(nameof(entity2.Reference), entity2.GetType());

            Assert.Equal(typeof(RefDerived2), type2);

            var entity1 = new DocumentWithPropertyTypeOverride1();
            var type1   = EntityToBlittable.GetPropertyType(nameof(entity1.Reference), entity1.GetType());

            Assert.Equal(typeof(RefDerived2), type1);

            var entity0 = new DocumentBase();
            var type0   = EntityToBlittable.GetPropertyType(nameof(entity0.Reference), entity0.GetType());

            Assert.Equal(typeof(RefDerived1), type0);
        }