Пример #1
0
        private static TypeDefinition CheckTypeCreation(string @namespace, string @class)
        {
            var typeName   = string.IsNullOrEmpty(@namespace) ? @class : $"{@namespace}.{@class}";
            var module     = ModuleDefinition.CreateModule("foobar", ModuleKind.Dll);
            var baseType   = module.ImportReference(typeof(object));
            var objectInfo = new ObjectInfo(baseType)
            {
                TypeName = typeName
            };

            objectInfo.AddTypeDefinition(module);

            return(Assert.Single(module.Types, t => t.Namespace == @namespace && t.Name == @class));
        }