コード例 #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
ファイル: TagPlan.cs プロジェクト: calebjenkins/htmltags
        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);
        }
コード例 #7
0
        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);
        }
コード例 #8
0
        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);
        }