Example #1
0
 public SparkConventions(FubuConventions conventions)
 {
     _conventions           = conventions;
     ViewFileBasePath       = _conventions.ViewFileBasePath;
     DefaultLayoutName      = "~/Views/Shared/Application.spark";
     LayoutViewFileBasePath = "~/Views/Layouts";
 }
 public void SetUp()
 {
     _conv = new FubuConventions();
     DebugMode = true;
     _config = new FubuConfiguration(_conv);
     _configurer = new DebugOutputActionConfigurer(_conv, _config);
 }
 public SparkConventions(FubuConventions conventions)
 {
     _conventions = conventions;
     ViewFileBasePath = _conventions.ViewFileBasePath;
     DefaultLayoutName = "~/Views/Shared/Application.spark";
     LayoutViewFileBasePath = "~/Views/Layouts";
 }
 public void SetUp()
 {
     _outputModel = new TestOutputModel();
     _conventions = new FubuConventions();
     _behavior = new RedirectToNotFoundUrl(_conventions)
     {
         InsideBehavior = new DefaultBehavior()
     };
 }
 public void SetUp()
 {
     expectedRssExtension = "__EXPECTED_RSS__";
     expectedAtomExtension = "__EXPECTED_ATOM__";
     fubuConventions = new FubuConventions { DefaultRssExtension = expectedRssExtension, DefaultAtomExtension = expectedAtomExtension};
     convention = new wire_up_RSS_and_ATOM_URLs_if_required {FubuConventions = fubuConventions};
     var method = ReflectionHelper.GetMethod<TestController>(c => c.SomeAction(null));
     config = new ControllerActionConfig(method, null, null);
 }
        public void SetUp()
        {
            expectedJsonExtension = "__EXPECTED_JSON__";
            fubuConventions = new FubuConventions { DefaultJsonExtension = expectedJsonExtension };
            convention = new wire_up_JSON_URL { FubuConventions = fubuConventions };

            var method = ReflectionHelper.GetMethod<TestController>(c => c.SomeAction(null));
            config = new ControllerActionConfig(method, null, null);
        }
        public void SetUp()
        {
            _conventions = new FubuConventions();
            _config = new FubuConfiguration(_conventions);
            _dsl = new ControllerActionDSL(_config, _conventions);

            _dsl.ByDefault.EveryControllerAction(d => d
                .Will<TestBehavior>()
                .Will<TestBehavior2>());
        }
 public SparkViewRenderer(
     FubuConventions fubuConventions,
     SparkConventions sparkConventions,
     IControllerConfigContext context,
     ISparkViewEngine viewEngine)
 {
     _fubuConventions  = fubuConventions;
     _sparkConventions = sparkConventions;
     _context          = context;
     _viewEngine       = viewEngine;
 }
Example #9
0
 public void SetUp()
 {
     _renderer          = MockRepository.GenerateStub <IWebFormsViewRenderer>();
     _conventions       = new FubuConventions();
     _authenticatedUser = new User {
         IsAuthenticated = true
     };
     _notAuthenticatedUser = new User {
         IsAuthenticated = false
     };
     _expression = new LoginStatusExpression(null, _renderer, _conventions);
 }
 public void SetUp()
 {
     _controller = new TestController();
     _behavior = MockRepository.GenerateStub<IControllerActionBehavior>();
     _context = MockRepository.GenerateStub<IControllerConfigContext>();
     _curConfig = _context.CurrentConfig =
         new ControllerActionConfig(typeof (RedirectActionInvoker<TestController, TestInputModel>));
     _curConfig.ActionDelegate = new Action<TestController, TestInputModel>((c, i) => c.RedirectAction(i));
     _expectedUrl = "EXPECTED_URL";
     var conventions = new FubuConventions {PrimaryApplicationUrl = _expectedUrl};
     _invoker = new RedirectActionInvoker<TestController, TestInputModel>(_controller, _behavior, conventions, _context);
     BeforeEach();
 }
Example #11
0
    public ControllerConfig()
    {
        var conventions = new FubuConventions();
            var configuration = new FubuConfiguration(conventions);

            var dsl = new ControllerActionDSL(configuration, conventions);

            Configure(dsl);

            //TODO: one day, these things will be conventionally discovered
            new DebugOutputActionConfigurer(conventions, configuration).Configure();
            new NotFoundActionConfigurer(configuration).Configure();

            var configurer = new StructureMapConfigurer(conventions, configuration);
            configurer.ConfigureRegistry(this);
    }
        public void SetUp()
        {
            _conventions = new FubuConventions();

            _view = MockRepository.GenerateStub<IFubuView<TestModel>>();
            _renderer = MockRepository.GenerateStub<IWebFormsViewRenderer>();

            _model = new TestModel();
            _partialModel = new PartialTestModel();

            _model.PartialModel = _partialModel;

            _view.Stub(v => v.Model).Return(_model);

            _forExpression = new RenderPartialExpression(_view, _renderer, _conventions)
                                .Using<TestUserControl>();
        }
Example #13
0
        public void SetUp()
        {
            _root = "fake";
            _actionUrl = "test/someaction";
            _controllerUrl = "test";
            UrlContext.Stub(_root);

            _conventions = new FubuConventions();
            _config = new FubuConfiguration(_conventions);

            var method = ReflectionHelper.GetMethod<TestController>(c => c.SomeAction(null));
            var actionConfig = new ControllerActionConfig(method, null, null);

            actionConfig.PrimaryUrl = _actionUrl;

            _config.AddControllerActionConfig(actionConfig);
        }
        public void SetUp()
        {
            var method = ReflectionHelper.GetMethod<TestController>(c => c.SomeAction(null));
            _config = new ControllerActionConfig(method, null, null);

            method = ReflectionHelper.GetMethod<TestController>(c => c.AnotherAction(null));
            _otherConfig = new ControllerActionConfig(method, null, null);

            _config.PrimaryUrl = "test/someaction";
            _otherConfig.PrimaryUrl = "test/anotheraction";

            _conventions = new FubuConventions();
            _fubuConfig = new FubuConfiguration(_conventions);
            _fubuConfig.AddControllerActionConfig(_config);
            _fubuConfig.AddControllerActionConfig(_otherConfig);
            _registry = new RouteConfigurer(_fubuConfig, _conventions);
            _registry.Configure();
        }
        public void SetUp()
        {
            _standardConfigurer = MockRepository.GenerateMock<IControllerActionConfigurer>();
            _conventions = new FubuConventions();
            _assemblyExpression = new AssemblyControllerScanningExpression(_conventions, new[] { _standardConfigurer });
            var action = typeof(TestController).GetMethod("AnotherAction");
            _standardConfigurer.Stub(c => c.ShouldConfigure(null)).IgnoreArguments().Return(true);
            _standardConfigurer.Stub(c => c.Configure(null)).IgnoreArguments().Return(new ControllerActionConfig(action, null, null));

            _expectedUrl = "EXPECTED_URL";
            _conventions.PrimaryUrlConvention = config => _expectedUrl;

            _assemblyExpression.UsingTypesInTheSameAssemblyAs<TestController>(types =>
                  from t in types
                  where t == typeof(TestController)
                  from m in t.GetMethods()
                  where m.Name.EndsWith("Action") && m.GetParameters()[0].ParameterType != typeof(Int32)
                  select m);
        }
        public void SetUp()
        {
            _conventions = new FubuConventions();
            _standardConfigurer = MockRepository.GenerateMock<IControllerActionConfigurer>();
            _configurer = MockRepository.GenerateMock<IControllerActionConfigurer>();

            _assemblyExpression = new AssemblyControllerScanningExpression(_conventions, new[]{_standardConfigurer});
            _assemblyExpression.UsingConfigurer(_configurer);
        }
 public LoginStatusExpression(IFohjinPage viewPage, IWebFormsViewRenderer renderer, FubuConventions conventions)
 {
     _viewPage    = viewPage;
     _renderer    = renderer;
     _conventions = conventions;
 }
 public void SetUp()
 {
     expectedPrimaryUrl = "__EXPECTED_404__";
     fubuConventions = new FubuConventions {PageNotFoundUrl = expectedPrimaryUrl};
     convention = new wire_up_404_handler_URL {FubuConventions = fubuConventions};
 }
 public DebugController(FubuConventions conventions, FubuConfiguration configuration)
 {
     _conventions   = conventions;
     _configuration = configuration;
 }
 public DebugController(FubuConventions conventions, FubuConfiguration configuration)
 {
     _conventions = conventions;
     _configuration = configuration;
 }
 public DebugOutputActionConfigurer(FubuConventions conventions, FubuConfiguration configuration)
 {
     _conventions = conventions;
     _config = configuration;
 }