예제 #1
0
        public void do_nothing_if_it_is_not_an_input_element()
        {
            theRequest.ReplaceTag(new HtmlTag("div"));

            new AddNameModifier().Modify(theRequest);

            theRequest.CurrentTag.HasAttr("name").ShouldBeFalse();
        }
예제 #2
0
        public void SetUp()
        {
            theStrategy = new CssValidationAnnotationStrategy();
            theTag      = new HtmlTag("input");

            theRequest = ElementRequest.For <CssTarget>(x => x.Name);
            theRequest.ReplaceTag(theTag);
        }
        public void SetUp()
        {
            theStrategy = new CssValidationAnnotationStrategy();
            theTag = new HtmlTag("input");

            theRequest = ElementRequest.For<CssTarget>(x => x.Name);
            theRequest.ReplaceTag(theTag);
        }
예제 #4
0
        public HtmlTag Build(ElementRequest request)
        {
            request.ElementId = string.IsNullOrEmpty(request.ElementId)
                ? ElementNamingConvention.GetName(request.HolderType(), request.Accessor)
                : request.ElementId;

            var tag = Builder.Build(request);
            request.ReplaceTag(tag);

            _modifiers.Each(m => m.Modify(request));

            return request.CurrentTag;
        }
        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()
        {
            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);
        }