override public Type BuildType() { TypeBuilder typeBuilder = CreateTypeBuilder(); typeBuilder.AddInterfaceImplementation(typeof(NBehaveMock)); NBehavePropertyBuilder nbehaveBuilder = new NBehavePropertyBuilder(typeBuilder); PropertyInfo nbehaveProperty = nbehaveBuilder.Build(); BuildConstructor(typeBuilder, nbehaveBuilder); OverrideMethods(typeBuilder, nbehaveProperty); return(typeBuilder.CreateType()); }
override public Type BuildType() { TypeBuilder typeBuilder = moduleBuilder.DefineType(type.FullName, TypeAttributes.Public | TypeAttributes.Class | TypeAttributes.AutoClass, null); typeBuilder.AddInterfaceImplementation(type); typeBuilder.AddInterfaceImplementation(typeof(NBehaveMock)); NBehavePropertyBuilder nbehaveBuilder = new NBehavePropertyBuilder(typeBuilder); PropertyInfo nbehaveProperty = nbehaveBuilder.Build(); BuildConstructor(typeBuilder, nbehaveBuilder); ImplementMethods(typeBuilder, nbehaveProperty); return(typeBuilder.CreateType()); }