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());
                }
            }
        }
        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());
                }
            }
        }
        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());
                }
            }
        }
        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());
                }
            }
        }
        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());
                }
            }
        }
        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());
                }
            }
        }
        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());
                }
            }
        }
        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);
                }
            }
        }
        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());
                }
            }
        }
Beispiel #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);
                }
            }
        }
Beispiel #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);
                }
            }
        }
Beispiel #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);
                }
            }
        }
Beispiel #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());
                }
            }
        }
Beispiel #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());
                }
            }
        }