Ejemplo n.º 1
0
        public void AssembliesHaveTheSameTypesAfterMigration(string supportDll, string androidXDll, bool ignoreResourceType, CecilMigrationResult expectedResult)
        {
            var migratedDll = RunMigration(supportDll, expectedResult);

            using (var migrated = AssemblyDefinition.ReadAssembly(migratedDll))
                using (var androidx = AssemblyDefinition.ReadAssembly(androidXDll))
                {
                    CecilAssert.Equal(androidx.GetPublicTypes(ignoreResourceType), migrated.GetPublicTypes(ignoreResourceType));
                }
        }
Ejemplo n.º 2
0
        public void AssembliesHaveTheSameReferencesAfterMigration(string supportDll, string androidXDll, CecilMigrationResult expectedResult)
        {
            var migratedDll = RunMigration(supportDll, expectedResult);

            using (var migrated = AssemblyDefinition.ReadAssembly(migratedDll))
                using (var androidx = AssemblyDefinition.ReadAssembly(androidXDll))
                {
                    CecilAssert.Equal(
                        androidx.MainModule.AssemblyReferences.OrderBy(a => a.Name),
                        migrated.MainModule.AssemblyReferences.OrderBy(a => a.Name));
                }
        }
Ejemplo n.º 3
0
        public void AllTypesHaveTheSameMembers(string supportDll, string androidXDll, bool ignoreResourceType, CecilMigrationResult expectedResult)
        {
            var migratedDll = RunMigration(supportDll, expectedResult);

            using (var migrated = AssemblyDefinition.ReadAssembly(migratedDll))
                using (var androidx = AssemblyDefinition.ReadAssembly(androidXDll))
                {
                    var mTypes = migrated.GetPublicTypes(ignoreResourceType).OrderBy(t => t.FullName).ToArray();
                    var xTypes = androidx.GetPublicTypes(ignoreResourceType).OrderBy(t => t.FullName).ToArray();

                    for (var i = 0; i < xTypes.Length; i++)
                    {
                        CecilAssert.Equal(xTypes[i], mTypes[i]);
                    }
                }
        }