Esempio n. 1
0
        public void RadioButtonWithAttributesFromAnonymousObject_WithUnderscoreInName_TransformsUnderscoresToDashs()
        {
            HtmlHelperTest.AssertHelperTransformsAttributesUnderscoresToDashs((helper, attributes) =>
                                                                              helper.RadioButton("foo", true, attributes));

            HtmlHelperTest.AssertHelperTransformsAttributesUnderscoresToDashs((helper, attributes) =>
                                                                              helper.RadioButton("foo", true, true, attributes));
        }
        public void CheckboxWithAttributesFromAnonymousObject_WithUnderscoreInName_TransformsUnderscoresToDashs()
        {
            HtmlHelperTest.AssertHelperTransformsAttributesUnderscoresToDashs((helper, attributes) =>
                                                                              helper.CheckBox("foo", attributes));

            HtmlHelperTest.AssertHelperTransformsAttributesUnderscoresToDashs((helper, attributes) =>
                                                                              helper.CheckBox("foo", true, attributes));
        }
        public void ValidationMessageWithAttributesFromAnonymousObject_WithUnderscoreInName_TransformsUnderscoresToDashs()
        {
            HtmlHelperTest.AssertHelperTransformsAttributesUnderscoresToDashs((helper, attributes) =>
                                                                              helper.ValidationMessage("foo", attributes));

            HtmlHelperTest.AssertHelperTransformsAttributesUnderscoresToDashs((helper, attributes) =>
                                                                              helper.ValidationMessage("foo", "bar", attributes));
        }
        public void TextAreaWithAttributesFromAnonymousObject_WithUnderscoreInName_TransformsUnderscoresToDashs()
        {
            HtmlHelperTest.AssertHelperTransformsAttributesUnderscoresToDashs((helper, attributes) =>
                                                                              helper.TextArea("foo", attributes));

            HtmlHelperTest.AssertHelperTransformsAttributesUnderscoresToDashs((helper, attributes) =>
                                                                              helper.TextArea("foo", "value", attributes));

            HtmlHelperTest.AssertHelperTransformsAttributesUnderscoresToDashs((helper, attributes) =>
                                                                              helper.TextArea("foo", "value", 1, 1, attributes));
        }
        public void ListBoxWithAttributesFromAnonymousObject_WithUnderscoreInName_TransformsUnderscoresToDashs()
        {
            HtmlHelperTest.AssertHelperTransformsAttributesUnderscoresToDashs((helper, attributes) =>
                                                                              helper.ListBox("foo", GetSelectList(), attributes));

            HtmlHelperTest.AssertHelperTransformsAttributesUnderscoresToDashs((helper, attributes) =>
                                                                              helper.ListBox("foo", "val", GetSelectList(), "val", attributes));

            HtmlHelperTest.AssertHelperTransformsAttributesUnderscoresToDashs((helper, attributes) =>
                                                                              helper.ListBox("foo", "val", GetSelectList(), "val", attributes));
        }
        public void ValidationSummaryWithAttributesFromAnonymousObject_WithUnderscoreInName_TransformsUnderscoresToDashs()
        {
            // Arrange
            var modelState = new ModelStateDictionary();

            modelState.AddFormError("error");

            HtmlHelper htmlHelper = HtmlHelperFactory.Create(modelState);

            HtmlHelperTest.AssertHelperTransformsAttributesUnderscoresToDashs((helper, attributes) =>
                                                                              htmlHelper.ValidationSummary(attributes));

            HtmlHelperTest.AssertHelperTransformsAttributesUnderscoresToDashs((helper, attributes) =>
                                                                              htmlHelper.ValidationSummary("foo", attributes));

            HtmlHelperTest.AssertHelperTransformsAttributesUnderscoresToDashs((helper, attributes) =>
                                                                              htmlHelper.ValidationSummary("foo", true, attributes));
        }