test/Misc/EFTools/UnitTests/EntityDesignerVersioningFacade/LegacyProviderWrapper/LegacyMetadataExtensions/TypeUsageExtensionsTests.cs
/// <summary>
///     Type conversion relies on the fact that PrimitiveTypeKind enum members in EF6 have the
///     same values as they had in EF5 and therefore to convert a legacy PrimitiveTypeKind to
///     EF6 PrimitiveTypeKind we can the original value to int and recast it to EF6 PrimitiveTypeKind.
///     If for some reason this changes type conversion will stop working. This test exists to
///     detect this kind of change.
/// </summary>
Type conversion relies on the fact that PrimitiveTypeKind enum members in EF6 have the
same values as they had in EF5 and therefore to convert a legacy PrimitiveTypeKind to
EF6 PrimitiveTypeKind we can the original value to int and recast it to EF6 PrimitiveTypeKind.
If for some reason this changes type conversion will stop working. This test exists to
detect this kind of change.
Type conversion relies on the fact that PrimitiveTypeKind enum members in EF6 have the same values as they had in EF5 and therefore to convert a legacy PrimitiveTypeKind to EF6 PrimitiveTypeKind we can the original value to int and recast it to EF6 PrimitiveTypeKind . If for some reason this changes type conversion will stop working . This test exists to detect this kind of change .
[Fact]
        public void Verify_PrimitiveTypeKind_enum_values_not_changed()
        {
            foreach (var legacyPrimitiveTypeKind in typeof(LegacyMetadata.PrimitiveTypeKind).GetEnumValues())
            {
                var primitiveTypeKind = (PrimitiveTypeKind)Enum.Parse(typeof(PrimitiveTypeKind), legacyPrimitiveTypeKind.ToString());
                Assert.Equal((int)legacyPrimitiveTypeKind, (int)primitiveTypeKind);
            }
        }
[ Fact ] public void Verify_PrimitiveTypeKind_enum_values_not_changed ( ) { foreach ( var legacyPrimitiveTypeKind in typeof ( LegacyMetadata . PrimitiveTypeKind ) . GetEnumValues ( ) ) { var primitiveTypeKind = ( PrimitiveTypeKind ) Enum . Parse ( typeof ( PrimitiveTypeKind ) , legacyPrimitiveTypeKind . ToString ( ) ) ; Assert . Equal ( ( int ) legacyPrimitiveTypeKind , ( int ) primitiveTypeKind ) ; } }
Type conversion relies on the fact that PrimitiveTypeKind enum members in EF6 have the
same values as they had in EF5 and therefore to convert a legacy PrimitiveTypeKind to
EF6 PrimitiveTypeKind we can the original value to int and recast it to EF6 PrimitiveTypeKind.
Type conversion relies on the fact that PrimitiveTypeKind enum members in EF6 have the same values as they had in EF5 and therefore to convert a legacy PrimitiveTypeKind to EF6 PrimitiveTypeKind we can the original value to int and recast it to EF6 PrimitiveTypeKind .