public void SetUp()
        {
            services = new SelfMockingServiceLocator();
            services.Stub<ITypeResolver>(new TypeResolver());

            var accessor = ReflectionHelper.GetAccessor<TheModel>(x => x.Name);

            theRequest = MockRepository.GeneratePartialMock<ElementRequest>(accessor);
            theRequest.Model = new TheModel();

            theRequest.Attach(services);
        }
예제 #2
0
        public void SetUp()
        {
            services = new SelfMockingServiceLocator();
            services.Stub <ITypeResolver>(new TypeResolver());

            var accessor = ReflectionHelper.GetAccessor <TheModel>(x => x.Name);

            theRequest       = MockRepository.GeneratePartialMock <ElementRequest>(accessor);
            theRequest.Model = new TheModel();

            theRequest.Attach(services);
        }
        public void SetUp()
        {
            theRequest = ElementRequest.For<Address>(x => x.Address1);
            theAddress = new Address{
                Address1 = "22 Cherry Tree Lane"
            };

            var services = new InMemoryServiceLocator();
            services.Add(new Stringifier());
            theRequest.Attach(services);

            theRequest.Model = theAddress;
        }
예제 #4
0
        public HtmlTag Build(ElementRequest request, string category = null, string profile = null)
        {
            profile = profile ?? _profile.Name ?? TagConstants.Default;
            category = category ?? TagConstants.Default;

            var token = request.ToToken();

            var plan = _library.PlanFor(token, profile, category);

            request.Attach(_serviceLocator);

            return plan.Build(request);
        }
        public void SetUp()
        {
            theRequest = ElementRequest.For<FieldValidationModifierTarget>(x => x.Name);
            theModifier = new FieldValidationElementModifier();
            theFieldModifier = MockRepository.GenerateStub<IFieldValidationModifier>();

            theRequest.ReplaceTag(new HtmlTag("input"));

            theServices = new InMemoryServiceLocator();
            theServices.Add(ValidationGraph.BasicGraph());
            theServices.Add(theFieldModifier);

            theRequest.Attach(theServices);
        }
예제 #6
0
        public void SetUp()
        {
            theRequest       = ElementRequest.For <FieldValidationModifierTarget>(x => x.Name);
            theModifier      = new FieldValidationElementModifier();
            theFieldModifier = MockRepository.GenerateStub <IFieldValidationModifier>();

            theRequest.ReplaceTag(new HtmlTag("input"));

            theServices = new InMemoryServiceLocator();
            theServices.Add(ValidationGraph.BasicGraph());
            theServices.Add(theFieldModifier);

            theRequest.Attach(theServices);
        }
        public void SetUp()
        {
            theRequest = ElementRequest.For <Address>(x => x.Address1);
            theAddress = new Address {
                Address1 = "22 Cherry Tree Lane"
            };

            var services = new InMemoryServiceLocator();

            services.Add(new Stringifier());
            theRequest.Attach(services);

            theRequest.Model = theAddress;
        }
예제 #8
0
        public HtmlTag Build(ElementRequest request, string category = null, string profile = null)
        {
            profile  = profile ?? _profile.Name ?? TagConstants.Default;
            category = category ?? TagConstants.Default;

            var token = request.ToToken();

            token.Attach(_serviceLocator);

            var plan = _library.PlanFor(token, profile, category);

            request.Attach(_serviceLocator);

            return(plan.Build(request));
        }
        public void SetUp()
        {
            theModifier = new RemoteValidationElementModifier();
            theTag      = new HtmlTag("input");

            theRequest = ElementRequest.For <RemoteTarget>(x => x.Username);
            theRequest.ReplaceTag(theTag);

            theRemoteGraph = new RemoteRuleGraph();
            theRemoteRule  = theRemoteGraph.RegisterRule(theRequest.Accessor, new UniqueUsernameRule());

            theUrls = new StubUrlRegistry();

            theServices = new InMemoryServiceLocator();
            theServices.Add(theRemoteGraph);
            theServices.Add(theUrls);

            theRequest.Attach(theServices);
        }
        public void SetUp()
        {
            theModifier = new RemoteValidationElementModifier();
            theTag = new HtmlTag("input");

            theRequest = ElementRequest.For<RemoteTarget>(x => x.Username);
            theRequest.ReplaceTag(theTag);

            theRemoteGraph = new RemoteRuleGraph();
            theRemoteRule = theRemoteGraph.RegisterRule(theRequest.Accessor, new UniqueUsernameRule());

            theUrls = new StubUrlRegistry();

            theServices = new InMemoryServiceLocator();
            theServices.Add(theRemoteGraph);
            theServices.Add(theUrls);

            theRequest.Attach(theServices);
        }