public void Create_CallingParameterizedBaseClassConstructor(Visibility visibility, Type[] parameterTypes)
        {
            // pass a callback method to call when it comes to implementing the call of a base class constructor
            // (empty implementation, as it is not significant for this test...)
            ImplementBaseClassConstructorCallCallback callback = (constructorDefinition, typeBuilder, msil) => { };
            ConstructorDefinition definition = new ConstructorDefinition(visibility, parameterTypes, callback);

            Assert.Equal(visibility, definition.AccessModifier);
            Assert.Equal(parameterTypes, definition.ParameterTypes);
            Assert.Same(callback, definition.ImplementBaseClassConstructorCallCallback);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="ConstructorDefinition"/> class.
        /// </summary>
        /// <param name="accessModifier">Access modifier determining the visibility of the constructor.</param>
        /// <param name="parameterTypes">Types of the parameters of the constructor to create.</param>
        /// <param name="implementBaseClassConstructorCall">
        /// Callback that implements the call to a base class constructor, if the type under construction derives from another type;
        /// null to call the parameterless constructor of the base class.
        /// </param>
        public ConstructorDefinition(Visibility accessModifier, Type[] parameterTypes, ImplementBaseClassConstructorCallCallback implementBaseClassConstructorCall = null)
        {
            if (parameterTypes == null)
            {
                throw new ArgumentNullException(nameof(parameterTypes));
            }

            mAccessModifier = accessModifier;
            mParameterTypes = new List <Type>(parameterTypes);
            mImplementBaseClassConstructorCallCallback = implementBaseClassConstructorCall;

            // calculate the hash code of the constructor definition
            // => use the hash codes of the constructor parameter types as these types identify the constructor uniquely
            mHashCode = mAccessModifier.GetHashCode();
            foreach (var type in mParameterTypes)
            {
                mHashCode ^= type.GetHashCode();
            }
        }