예제 #1
0
        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());
        }
예제 #2
0
        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());
        }