Пример #1
0
        protected void Run(Type type, string methodName)
        {
            classContext = new ClassContext(type);

            var method = type.Methods().Single(s => s.Name == methodName);

            methodContext = new MethodContext(method);

            classContext.AddContext(methodContext);

            classContext.Run();
        }
        public void setup()
        {
            reflector = MockRepository.GenerateMock<IReflector>();

            RhinoMocksExtensions.Stub(reflector, r => r.GetTypesFrom("")).IgnoreArguments().Return(new[] { typeof(SpecClass) });

            var contextBuilder = new ContextBuilder(new SpecFinder("", reflector), new DefaultConventions());

            classContext = contextBuilder.Contexts().First();

            classContext.Build();

            classContext.Run(new SilentLiveFormatter(), failFast: false);
        }
Пример #3
0
        public void setup()
        {
            var finder = MockRepository.GenerateMock<ISpecFinder>();

            finder.Stub(f => f.Except).Return(new SpecFinder().Except);

            finder.Stub(s => s.SpecClasses()).Return(new[] { typeof(SpecClass) });

            var builder = new ContextBuilder(finder);

            classContext = new Context("class");

            classContext.Type = typeof(SpecClass);

            builder.BuildMethodContexts(classContext, typeof(SpecClass));

            classContext.Run();
        }