public bool TestGenericTypeProperty() { ITypeDefinition assemType = Helper.GetNamespaceType(this.ModuleReaderTest.AssemblyAssembly.UnitNamespaceRoot, this.Assem); IFieldDefinition fld = Helper.GetFieldNamed(assemType, this.Generic1); ITypeDefinition type = fld.Type.ResolvedType; IPropertyDefinition prop = Helper.GetPropertyNamed(type, this.propT); StringILDasmPaper stringPaper = new StringILDasmPaper(2); ILDasmPrettyPrinter prettyPrinter = new ILDasmPrettyPrinter(stringPaper, this.ModuleReaderTest.TestAssembly); prettyPrinter.PropertyDefinition(prop); string result = @".property public instance default int32 propT() { .get instance int32[MRW_Assembly]Generic1`1<int32>::get_propT() .set instance void[MRW_Assembly]Generic1`1<int32>::set_propT(int32) } "; return result.Equals(stringPaper.Content); }
public bool TestListItemProperty() { ITypeDefinition type = Helper.GetNamespaceType(Helper.GetNamespace(this.ModuleReaderTest.MscorlibAssembly, this.System, this.Collections, this.Generic), this.List); IPropertyDefinition property = Helper.GetPropertyNamed(type, this.Item); StringILDasmPaper stringPaper = new StringILDasmPaper(2); ILDasmPrettyPrinter prettyPrinter = new ILDasmPrettyPrinter(stringPaper, this.ModuleReaderTest.MscorlibAssembly); prettyPrinter.PropertyDefinition(property); string result = @".property public instance default!0 Item( int32 ) { .get instance!0 System.Collections.Generic.List`1::get_Item(int32) .set instance void System.Collections.Generic.List`1::set_Item(int32,!0) } "; return result.Equals(stringPaper.Content); }