Пример #1
0
        public void Translate_from_long_to_long_should_not_always_return_zero()
        {
            using (var context = new EnumyCatContext())
            {
                var objectContext = ((IObjectContextAdapter)context).ObjectContext;

                using (var dtr = CreateLongReader())
                {
                    Assert.Equal(3L, objectContext.Translate<long>(dtr).Single());
                }
            }
        }
Пример #2
0
        public void Translate_from_long_to_enum_in_the_model_should_not_always_return_zero()
        {
            using (var context = new EnumyCatContext())
            {
                var objectContext = ((IObjectContextAdapter)context).ObjectContext;

                using (var dtr = CreateLongReader())
                {
                    Assert.Equal(LongBreedType.NorwegianForestCat, objectContext.Translate <LongBreedType>(dtr).Single());
                }
            }
        }
Пример #3
0
        public void Translate_from_long_to_enum_in_the_model_should_not_always_return_zero()
        {
            using (var context = new EnumyCatContext())
            {
                var objectContext = ((IObjectContextAdapter)context).ObjectContext;

                using (var dtr = CreateLongReader())
                {
                    Assert.Equal(LongBreedType.NorwegianForestCat, objectContext.Translate<LongBreedType>(dtr).Single());
                }
            }
        }
Пример #4
0
        public void Translate_from_long_to_long_should_not_always_return_zero()
        {
            using (var context = new EnumyCatContext())
            {
                var objectContext = ((IObjectContextAdapter)context).ObjectContext;

                using (var dtr = CreateLongReader())
                {
                    Assert.Equal(3L, objectContext.Translate <long>(dtr).Single());
                }
            }
        }
Пример #5
0
        public void Translate_from_int_to_enum_not_in_the_model_should_not_always_return_zero()
        {
            using (var context = new EnumyCatContext())
            {
                var objectContext = ((IObjectContextAdapter)context).ObjectContext;

                using (var dtr = CreateIntReader())
                {
                    Assert.Equal(EnumNotInModel.NorwegianForestCat,
                                 objectContext.Translate<EnumNotInModel>(dtr).Single());
                }
            }
        }
Пример #6
0
        public void Translate_from_unsigned_long_to_unsigned_long_should_always_return_zero()
        {
            using (var context = new EnumyCatContext())
            {
                var objectContext = ((IObjectContextAdapter)context).ObjectContext;

                using (var dtr = CreateULongReader())
                {
                    // Will always return zero because EF does not understand unsigned longs
                    Assert.Equal(0UL, objectContext.Translate <ulong>(dtr).Single());
                }
            }
        }
Пример #7
0
        public void Translate_from_int_to_enum_not_in_the_model_should_not_always_return_zero()
        {
            using (var context = new EnumyCatContext())
            {
                var objectContext = ((IObjectContextAdapter)context).ObjectContext;

                using (var dtr = CreateIntReader())
                {
                    Assert.Equal(
                        EnumNotInModel.NorwegianForestCat,
                        objectContext.Translate <EnumNotInModel>(dtr).Single());
                }
            }
        }
Пример #8
0
        Translate_from_int_to_arbitary_class_containing_enum_not_in_the_model_should_not_always_populate_with_zero()
        {
            using (var context = new EnumyCatContext())
            {
                var objectContext = ((IObjectContextAdapter)context).ObjectContext;

                using (var dtr = CreateIntIntULongReader())
                {
                    var result = objectContext.Translate <ClassNotInModel>(dtr).Single();

                    Assert.Equal(EnumNotInModel.NorwegianForestCat, result.NotInModel);
                }
            }
        }
Пример #9
0
        public void Translate_from_unsigned_long_to_enum_not_in_the_model_should_always_return_zero()
        {
            using (var context = new EnumyCatContext())
            {
                var objectContext = ((IObjectContextAdapter)context).ObjectContext;

                using (var dtr = CreateULongReader())
                {
                    // Will always return zero because EF does not know understand unsigned long type
                    // which is the underlying type of the enum
                    Assert.Equal((ULongEnumNotInModel)0, objectContext.Translate <ULongEnumNotInModel>(dtr).Single());
                }
            }
        }
Пример #10
0
        public void Translate_from_int_to_arbitary_class_containing_ulong_model_always_populates_with_zero()
        {
            using (var context = new EnumyCatContext())
            {
                var objectContext = ((IObjectContextAdapter)context).ObjectContext;

                using (var dtr = CreateIntIntULongReader())
                {
                    var result = objectContext.Translate <ClassNotInModel>(dtr).Single();

                    // Property will always be zero because EF does not know about unsigned longs
                    Assert.Equal(0UL, result.ULong);
                }
            }
        }
Пример #11
0
        public void Translate_from_int_to_arbitary_class_containing_ulong_model_always_populates_with_zero()
        {
            using (var context = new EnumyCatContext())
            {
                var objectContext = ((IObjectContextAdapter)context).ObjectContext;

                using (var dtr = CreateIntIntULongReader())
                {
                    var result = objectContext.Translate<ClassNotInModel>(dtr).Single();

                    // Property will always be zero because EF does not know about unsigned longs
                    Assert.Equal(0UL, result.ULong);
                }
            }
        }
Пример #12
0
            Translate_from_int_to_arbitary_class_containing_enum_not_in_the_model_should_not_always_populate_with_zero()
        {
            using (var context = new EnumyCatContext())
            {
                var objectContext = ((IObjectContextAdapter)context).ObjectContext;

                using (var dtr = CreateIntIntULongReader())
                {
                    var result = objectContext.Translate<ClassNotInModel>(dtr).Single();

                    Assert.Equal(EnumNotInModel.NorwegianForestCat, result.NotInModel);
                }
            }
        }
Пример #13
0
        public void Translate_from_unsigned_long_to_enum_not_in_the_model_should_always_return_zero()
        {
            using (var context = new EnumyCatContext())
            {
                var objectContext = ((IObjectContextAdapter)context).ObjectContext;

                using (var dtr = CreateULongReader())
                {
                    // Will always return zero because EF does not know understand unsigned long type 
                    // which is the underlying type of the enum
                    Assert.Equal((ULongEnumNotInModel)0, objectContext.Translate<ULongEnumNotInModel>(dtr).Single());
                }
            }
        }
Пример #14
0
        public void Translate_from_unsigned_long_to_unsigned_long_should_always_return_zero()
        {
            using (var context = new EnumyCatContext())
            {
                var objectContext = ((IObjectContextAdapter)context).ObjectContext;

                using (var dtr = CreateULongReader())
                {
                    // Will always return zero because EF does not understand unsigned longs
                    Assert.Equal(0UL, objectContext.Translate<ulong>(dtr).Single());
                }
            }
        }