예제 #1
0
        public void SetUp()
        {
            _page = MockRepository.GenerateMock <IFubuPage>();
            _urls = new StubUrlRegistry();
            _page.Stub(p => p.Urls).Return(_urls);

            var endpoints = new EndpointService(new StubAuthorizationPreviewService(), _urls);

            _page.Stub(p => p.Get <IEndpointService>()).Return(endpoints);
        }
        public void SetUp()
        {
            thePage = MockRepository.GenerateMock<IFubuPage>();
            theRequirements = MockRepository.GenerateMock<IAssetRequirements>();

            thePage.Stub(x => x.Get<IAssetRequirements>()).Return(theRequirements);

            theWriter = MockRepository.GenerateMock<IAssetTagWriter>();
            thePage.Stub(x => x.Get<IAssetTagWriter>()).Return(theWriter);

            theTagList = new TagList(new HtmlTag[0]);
        }
        public void SetUp()
        {
            thePage         = MockRepository.GenerateMock <IFubuPage>();
            theRequirements = MockRepository.GenerateMock <IAssetRequirements>();

            thePage.Stub(x => x.Get <IAssetRequirements>()).Return(theRequirements);

            theWriter = MockRepository.GenerateMock <IAssetTagWriter>();
            thePage.Stub(x => x.Get <IAssetTagWriter>()).Return(theWriter);

            theTagList = new TagList(new HtmlTag[0]);
        }
예제 #4
0
        public void SetUp()
        {
            _page           = MockRepository.GenerateStub <IFubuPage>();
            _partialFactory = MockRepository.GenerateStub <IPartialFactory>();
            _behavior       = MockRepository.GenerateStub <IActionBehavior>();

            _partialFactory.Stub(f => f.BuildPartial(typeof(InputModel))).Return(_behavior);
            _page.Stub(p => p.Get <IPartialFactory>()).Return(_partialFactory);


            _request = MockRepository.GenerateStub <IFubuRequest>();
            _page.Stub(p => p.Get <IFubuRequest>()).Return(_request);
        }
예제 #5
0
        public void SetUp()
        {
            _page                    = MockRepository.GenerateStub <IFubuPage>();
            _partialFactory          = MockRepository.GenerateStub <IPartialFactory>();
            _behavior                = new WrappingBehavior();
            PartialInvokingHandler   = MockRepository.GenerateStub <IPartialInvokingHandler>();
            _behavior.InsideBehavior = new PartialHandlingBehavior();

            _partialFactory.Stub(f => f.BuildPartial(typeof(InputModel))).Return(_behavior);
            _page.Stub(p => p.Get <IPartialFactory>()).Return(_partialFactory);

            _request = MockRepository.GenerateStub <IFubuRequest>();
            _page.Stub(p => p.Get <IFubuRequest>()).Return(_request);
        }
예제 #6
0
        public void SetUp()
        {
            _page = MockRepository.GenerateStub<IFubuPage>();
            _partialFactory = MockRepository.GenerateStub<IPartialFactory>();
            _behavior = new WrappingBehavior();
            PartialInvokingHandler = MockRepository.GenerateStub<IPartialInvokingHandler>();
            _behavior.InsideBehavior = new PartialHandlingBehavior();

            _partialFactory.Stub(f => f.BuildPartial(typeof(InputModel))).Return(_behavior);
            _page.Stub(p => p.Get<IPartialFactory>()).Return(_partialFactory);

            _request = MockRepository.GenerateStub<IFubuRequest>();
            _page.Stub(p => p.Get<IFubuRequest>()).Return(_request);
        }
예제 #7
0
        public void SetUp()
        {
            _page     = MockRepository.GenerateMock <IFubuPage <InputModel> >();
            _renderer = MockRepository.GenerateStub <IPartialRenderer>();
            var serviceLocator   = MockRepository.GenerateStub <IServiceLocator>();
            var namingConvention = MockRepository.GenerateStub <IElementNamingConvention>();

            _tags = new TagGenerator <InputModel>(new TagProfileLibrary(), namingConvention,
                                                  serviceLocator);

            _viewTypeRegistry = MockRepository.GenerateStub <IPartialViewTypeRegistry>();
            serviceLocator.Stub(s => s.GetInstance <IPartialViewTypeRegistry>()).Return(_viewTypeRegistry);

            var inMemoryFubuRequest = new InMemoryFubuRequest();

            inMemoryFubuRequest.Set(new InputModel());

            _page.Stub(s => s.Get <IFubuRequest>()).Return(inMemoryFubuRequest);

            _model = new InputModel {
                Partials = new List <PartialModel> {
                    new PartialModel()
                }
            };
            _page.Expect(p => p.Get <ITagGenerator <InputModel> >()).Return(_tags);
            _page.Expect(p => p.Model).Return(_model);
            _page.Expect(p => p.Get <IPartialRenderer>()).Return(_renderer);
            _page.Expect(p => p.ServiceLocator).Return(serviceLocator);
        }
예제 #8
0
        public void SetUp()
        {
            urls = MockRepository.GenerateMock<IUrlRegistry>();
            page = MockRepository.GenerateMock<IFubuPage>();

            page.Stub(x => x.Urls).Return(urls);
        }
예제 #9
0
        public void SetUp()
        {
            urls = MockRepository.GenerateMock <IUrlRegistry>();
            page = MockRepository.GenerateMock <IFubuPage>();

            page.Stub(x => x.Urls).Return(urls);
        }
예제 #10
0
 public void SetUp()
 {
     _page = MockRepository.GenerateStub<IFubuPage<ViewModel>>();
     _convention = MockRepository.GenerateStub<IElementNamingConvention>();
     _expression = (x=>x.Property);
     _accessor = _expression.ToAccessor();
     _convention.Stub(c => c.GetName(Arg<Type>.Is.Equal(typeof (ViewModel)), Arg<Accessor>.Is.Equal(_accessor))).Return("name");
     _page.Stub(p => p.Get<IElementNamingConvention>()).Return(_convention);
 }
예제 #11
0
 public void SetUp()
 {
     _page       = MockRepository.GenerateStub <IFubuPage <ViewModel> >();
     _convention = MockRepository.GenerateStub <IElementNamingConvention>();
     _expression = (x => x.Property);
     _accessor   = _expression.ToAccessor();
     _convention.Stub(c => c.GetName(Arg <Type> .Is.Equal(typeof(ViewModel)), Arg <Accessor> .Is.Equal(_accessor))).Return("name");
     _page.Stub(p => p.Get <IElementNamingConvention>()).Return(_convention);
 }
        public void form_for_with_an_url()
        {
            page.Stub(x => x.Get <ICurrentHttpRequest>()).Return(new StubCurrentHttpRequest
            {
                TheApplicationRoot = "http://server"
            });

            page.FormFor("some action").Attr("action").ShouldEqual("http://server/some action");
        }
예제 #13
0
        public void SetUp()
        {
            var registry = new FubuRegistry(x =>
            {
                x.HtmlConvention <TestHtmlConventions>();
            });
            var container = new Container(x => x.For <IFubuRequest>().Singleton());

            FubuApplication.For(registry).StructureMap(container).Bootstrap();

            var generator = container.GetInstance <TagGenerator <ArbitraryModel> >();

            _page = MockRepository.GenerateMock <IFubuPage>();
            _page.Stub(p => p.Get <ITagGenerator <ArbitraryModel> >()).Return(generator);
            var fubuRequest = MockRepository.GenerateMock <IFubuRequest>();

            _modelFromFubuRequest = new ArbitraryModel {
                City = "Austin"
            };
            fubuRequest.Stub(x => x.Get <ArbitraryModel>()).Return(_modelFromFubuRequest);
            _page.Stub(p => p.Get <IFubuRequest>()).Return(fubuRequest);
        }
예제 #14
0
        public void SetUp()
        {
            var registry  = new FubuRegistry(x => x.HtmlConvention <TestHtmlConventions>());
            var container = new Container(x => x.For <IFubuRequest>().Singleton());
            var facility  = new StructureMapContainerFacility(container);

            new FubuBootstrapper(facility, registry).Bootstrap(new List <RouteBase>());

            var generator = container.GetInstance <TagGenerator <ArbitraryModel> >();

            _page = MockRepository.GenerateMock <IFubuPage>();
            _page.Stub(p => p.Get <ITagGenerator <ArbitraryModel> >()).Return(generator);
            _givenModel = new ArbitraryModel {
                City = "Austin"
            };
        }
        public void SetUp()
        {
            _page = MockRepository.GenerateMock<IFubuPage<InputModel>>();
            _renderer = MockRepository.GenerateStub<IPartialRenderer>();
            var serviceLocator = MockRepository.GenerateStub<IServiceLocator>();
            var namingConvention = MockRepository.GenerateStub<IElementNamingConvention>();
            _tags = new TagGenerator<InputModel>(new TagProfileLibrary(), namingConvention,
                                                 serviceLocator);

            _viewTypeRegistry = MockRepository.GenerateStub<IPartialViewTypeRegistry>();
            serviceLocator.Stub(s => s.GetInstance<IPartialViewTypeRegistry>()).Return(_viewTypeRegistry);

            var inMemoryFubuRequest = new InMemoryFubuRequest();
            inMemoryFubuRequest.Set(new InputModel());

            _page.Stub(s => s.Get<IFubuRequest>()).Return(inMemoryFubuRequest);

            _model = new InputModel{Partials=new List<PartialModel>{new PartialModel()}};
            _page.Expect(p => p.Get<ITagGenerator<InputModel>>()).Return(_tags);
            _page.Expect(p => p.Model).Return(_model);
            _page.Expect(p => p.Get<IPartialRenderer>()).Return(_renderer);
            _page.Expect(p => p.ServiceLocator).Return(serviceLocator);
        }
        public void SetUp()
        {
            var registry = new FubuRegistry(x => x.HtmlConvention<TestHtmlConventions>());
            var container = new Container(x => x.For<IFubuRequest>().Singleton());
            var facility = new StructureMapContainerFacility(container);
            new FubuBootstrapper(facility, registry).Bootstrap(new List<RouteBase>());

            var generator = container.GetInstance<TagGenerator<ArbitraryModel>>();
            _page = MockRepository.GenerateMock<IFubuPage>();
            _page.Stub(p => p.Get<TagGenerator<ArbitraryModel>>()).Return(generator);
            _givenModel = new ArbitraryModel { City = "Austin" };
        }
 public void SetUp()
 {
     _page = MockRepository.GenerateMock<IFubuPage>();
     _urls = new StubUrlRegistry();
     _model = new InputModel();
     _page.Stub(p => p.Urls).Return(_urls);
 }
예제 #18
0
        public void SetUp()
        {
            _page = MockRepository.GenerateStub<IFubuPage>();
            _partialFactory = MockRepository.GenerateStub<IPartialFactory>();
            _behavior = MockRepository.GenerateStub<IActionBehavior>();

            _partialFactory.Stub(f => f.BuildPartial(typeof (InputModel))).Return(_behavior);
            _page.Stub(p => p.Get<IPartialFactory>()).Return(_partialFactory);

            _request = MockRepository.GenerateStub<IFubuRequest>();
            _page.Stub(p => p.Get<IFubuRequest>()).Return(_request);
        }
예제 #19
0
        public void SetUp()
        {
            tags = new StubTagGenerator<ViewModel>();
            _expression = null;

            page = MockRepository.GenerateMock<IFubuPage<ViewModel>>();
            page.Stub(x => x.Get<ITagGenerator<ViewModel>>()).Return(tags);
            page.Stub(x => x.Model).Return(new ViewModel());

            fieldAccess = MockRepository.GenerateMock<IFieldAccessService>();
            page.Stub(x => x.Get<IFieldAccessService>()).Return(fieldAccess);
        }
예제 #20
0
        public void form_for_with_an_url()
        {
            page.Stub(x => x.Get <IHttpRequest>()).Return(OwinHttpRequest.ForTesting());

            page.FormFor("some action").Attr("action").ShouldEqual("/some action");
        }