src/Castle.Core.Tests/CustomModifiersTestCase.cs
/// <summary>
/// Emits types as specified by `this.modopts` and stores the dynamic assembly to disk.
/// The generated types are added to the `this.generatedTypes` dictionary for reference
/// in unit tests.
/// </summary>
Emits types as specified by `this.modopts` and stores the dynamic assembly to disk.
The generated types are added to the `this.generatedTypes` dictionary for reference
in unit tests.
Emits types as specified by ` this . modopts ` and stores the dynamic assembly to disk . The generated types are added to the ` this . generatedTypes ` dictionary for reference in unit tests .
[OneTimeSetUp]
		public void GenerateTypes()
		{
			const string assemblyName = "Castle.Core.Tests.CustomModifiersTestCaseDynamicAssembly";
			const string assemblyFileName = "Castle.Core.Tests.CustomModifiersTestCaseDynamicAssembly.dll";
			var moduleScope = new ModuleScope(
				savePhysicalAssembly: true,
				disableSignedModule: false,
				namingScope: new Generators.NamingScope(),
				strongAssemblyName: assemblyName,
				strongModulePath: assemblyFileName,
				weakAssemblyName: assemblyName,
				weakModulePath: assemblyFileName);
			foreach (var partialTypeName in CustomModifiersTestCase.customModifiers.Keys)
			{
				var customModifiers = CustomModifiersTestCase.customModifiers[partialTypeName];
				this.AddTypeWithCustomModifiersAsModoptOnParamType(moduleScope, partialTypeName, customModifiers);
				this.AddTypeWithCustomModifiersAsModreqOnParamType(moduleScope, partialTypeName, customModifiers);
				this.AddTypeWithCustomModifiersAsModoptOnReturnType(moduleScope, partialTypeName, customModifiers);
				this.AddTypeWithCustomModifiersAsModreqOnReturnType(moduleScope, partialTypeName, customModifiers);
			}
#if !__MonoCS__ 
			var assemblyPath = moduleScope.SaveAssembly();
			base.RunPEVerifyOnGeneratedAssembly(assemblyPath);
#endif
		}
[ OneTimeSetUp ] public void GenerateTypes ( ) { const string assemblyName = " " ; const string assemblyFileName = " " ; var moduleScope = new ModuleScope ( savePhysicalAssembly : true , disableSignedModule : false , namingScope : new Generators . NamingScope ( ) , strongAssemblyName : assemblyName , strongModulePath : assemblyFileName , weakAssemblyName : assemblyName , weakModulePath : assemblyFileName ) ; foreach ( var partialTypeName in CustomModifiersTestCase . customModifiers . Keys ) { var customModifiers = CustomModifiersTestCase . customModifiers [ partialTypeName ] ; this . AddTypeWithCustomModifiersAsModoptOnParamType ( moduleScope , partialTypeName , customModifiers ) ; this . AddTypeWithCustomModifiersAsModreqOnParamType ( moduleScope , partialTypeName , customModifiers ) ; this . AddTypeWithCustomModifiersAsModoptOnReturnType ( moduleScope , partialTypeName , customModifiers ) ; this . AddTypeWithCustomModifiersAsModreqOnReturnType ( moduleScope , partialTypeName , customModifiers ) ; } if ! __MonoCS__ var assemblyPath = moduleScope . SaveAssembly ( ) ; base . RunPEVerifyOnGeneratedAssembly ( assemblyPath ) ; endif }
Emits types as specified by `this.modopts` and stores the dynamic assembly to disk.
Emits types as specified by ` this . modopts ` and stores the dynamic assembly to disk .
// Mono doesn't have PEVerify // Let's persist and PE-verify the dynamic assembly before it gets used in tests: