Exemplo n.º 1
0
        public void TestDependencyMissingField()
        {
            PatchInstaller   installer = new PatchInstaller(new MockModuleSource(module));
            StandardPatch    patch     = new StandardPatch("TestPatch");
            TypeModification type      = patch.Module(module.Name, ModificationKind.FailIfMissing, true).Type(ReadOnlyNamespace, NormalClass, ModificationKind.FailIfMissing);

            type.Attributes = TypeAttributes.BeforeFieldInit;
            type.Field(MissingMember, new FieldSignature(new CorLibTypeSignature(new TypeReference(patch.Module("System.Runtime", ModificationKind.FailIfMissing, true), "System", "String", new ModuleReference("System.Runtime")), ElementType.String)), ModificationKind.FailIfMissing);
            installer.Add(patch);
            installer.Install();
        }