public async Task WhenBackLinkTagHelperCalled_ThenCorrectClassCalled()
        {
            var tagHelper = Substitute.For <IMockViewComponentHelper>();

            var componentTag = new BackLinkTagHelper(tagHelper);
            await ViewComponentTestHelper.CallTagHelper("BackLink", tagHelper, componentTag);
        }
        public async Task WhenLinkTagHelperCalled_ThenCorrectClassCalled()
        {
            var tagHelper = Substitute.For <IMockViewComponentHelper>();

            var componentTag = new LinkTagHelper(tagHelper)
            {
                AdditionalClass = "AdditionalClass",
                Class           = "Class",
                Id           = "Id",
                LinkHref     = "LinkHref",
                LinkTabIndex = 1,
                LinkText     = "LinkText",
                LinkTitle    = "LinkTitle"
            };
            string additionalClass = componentTag.AdditionalClass;
            string id           = componentTag.Id;
            string linkHref     = componentTag.LinkHref;
            int    linkTabIndex = componentTag.LinkTabIndex;
            string linkText     = componentTag.LinkText;
            string linkTitle    = componentTag.LinkTitle;
            string classProp    = componentTag.Class;


            await ViewComponentTestHelper.CallTagHelper("Link", tagHelper, componentTag);
        }
Esempio n. 3
0
        public async Task WhenAutoCompleteLabelTagHelperCalled_ThenCorrectClassCalled()
        {
            var tagHelper = Substitute.For <IMockViewComponentHelper>();

            var componentTag = new AutoCompleteLabelTagHelper(tagHelper)
            {
                Text = "LabelText", For = "ForText", AdditionalClass = "AdditionalClass"
            };
            await ViewComponentTestHelper.CallTagHelper("AutoCompleteLabel", tagHelper, componentTag);
        }
        public async Task WhenErrorSummaryItemHelperCalled_ThenCorrectClassCalled()
        {
            var tagHelper = Substitute.For <IMockViewComponentHelper>();

            var componentTag = new ErrorSummaryItemTagHelper(tagHelper)
            {
                Href = "href",
                Text = "text"
            };

            await ViewComponentTestHelper.CallTagHelper("ErrorSummaryItem", tagHelper, componentTag);
        }
        public async Task WhenErrorSummaryHelperCalled_ThenCorrectClassCalled()
        {
            var tagHelper = Substitute.For <IMockViewComponentHelper>();

            var componentTag = new ErrorSummaryTagHelper(tagHelper)
            {
                Id     = "Id",
                Hidden = true
            };

            await ViewComponentTestHelper.CallTagHelper("ErrorSummary", tagHelper, componentTag);
        }
        public async Task WhenRadioHintTagHelperCalled_ThenCorrectClassCalled()
        {
            var tagHelper = Substitute.For <IMockViewComponentHelper>();

            var componentTag = new RadioHintTagHelper(tagHelper);

            componentTag.HintText        = "HintText";
            componentTag.AdditionalClass = "AdditionalClass";
            componentTag.Id = "Id";

            await ViewComponentTestHelper.CallTagHelper("RadioHint", tagHelper, componentTag);
        }
        public async Task WhenListItemHelperCalled_ThenCorrectClassCalled()
        {
            var tagHelper = Substitute.For <IMockViewComponentHelper>();

            var componentTag = new ListItemTagHelper(tagHelper)
            {
                Text = "Test"
            };
            string text = componentTag.Text;

            await ViewComponentTestHelper.CallTagHelper("ListItem", tagHelper, componentTag);
        }
Esempio n. 8
0
        public async Task WhenErrorTagHelperCalled_ThenCorrectClassCalled()
        {
            var tagHelper = Substitute.For <IMockViewComponentHelper>();

            var componentTag = new ErrorTagHelper(tagHelper);

            componentTag.AdditionalClass = "AdditionalClass";
            componentTag.Id   = "Id";
            componentTag.Text = "ThisIsText";
            string additionalClass = componentTag.AdditionalClass;
            string id   = componentTag.Id;
            string text = componentTag.Text;

            await ViewComponentTestHelper.CallTagHelper("Error", tagHelper, componentTag);
        }
        public async Task WhenHeadingHelperCalled_ThenCorrectClassCalled()
        {
            var tagHelper = Substitute.For <IMockViewComponentHelper>();

            var componentTag = new HeadingTagHelper(tagHelper)
            {
                AdditionalClass = "AdditionalClass",
                Caption         = "Caption",
                Text            = "Text"
            };
            string additionalClass = componentTag.AdditionalClass;
            string caption         = componentTag.Caption;
            string text            = componentTag.Text;

            await ViewComponentTestHelper.CallTagHelper("Heading", tagHelper, componentTag);
        }
        public async Task WhenBulletedListHelperCalled_ThenCorrectClassCalled()
        {
            var tagHelper = Substitute.For <IMockViewComponentHelper>();

            var componentTag = new BulletedListTagHelper(tagHelper)
            {
                Id = "Id",
                AdditionalClass = "AdditionalClass",
                Text            = "Test"
            };
            string id = componentTag.Id;
            string additionalClass = componentTag.AdditionalClass;
            string text            = componentTag.Text;

            await ViewComponentTestHelper.CallTagHelper("BulletedList", tagHelper, componentTag);
        }
        public async Task WhenStartButtonHelperCalled_ThenCorrectClassCalled()
        {
            var tagHelper = Substitute.For <IMockViewComponentHelper>();

            var componentTag = new StartButtonTagHelper(tagHelper)
            {
                Id = "id",
                AdditionalClass = "AdditionalClass",
                Disabled        = false,
                Text            = "ButtonText"
            };
            string id = componentTag.Id;
            string additionalClass = componentTag.AdditionalClass;
            bool   disabled        = componentTag.Disabled;
            string text            = componentTag.Text;
            await ViewComponentTestHelper.CallTagHelper("StartButton", tagHelper, componentTag);
        }
        public async Task WhenPrimaryHeroBannerTagHelperCalled_ThenCorrectClassCalled()
        {
            var tagHelper = Substitute.For <IMockViewComponentHelper>();

            var componentTag = new PrimaryHeroBannerTagHelper(tagHelper)
            {
                Id            = "Id",
                HeaderText    = "HeaderText",
                SubheaderText = "SubHeaderText"
            };

            //For code coverage
            var id         = componentTag.Id;
            var headerText = componentTag.HeaderText;
            var subHeading = componentTag.SubheaderText;
            await ViewComponentTestHelper.CallTagHelper("PrimaryHeroBanner", tagHelper, componentTag);
        }
Esempio n. 13
0
        public async Task WhenRadioButtonHelperCalled_ThenCorrectClassCalled()
        {
            var tagHelper = Substitute.For <IMockViewComponentHelper>();

            var componentTag = new RadioButtonTagHelper(tagHelper)
            {
                Id              = "Id",
                Value           = "Value",
                AdditionalClass = "AdditionalClass",
                Name            = "Name",
                Checked         = true
            };
            string id              = componentTag.Id;
            string value           = componentTag.Value;
            string additionalClass = componentTag.AdditionalClass;
            bool   selected        = componentTag.Checked;

            await ViewComponentTestHelper.CallTagHelper("RadioButton", tagHelper, componentTag);
        }
Esempio n. 14
0
        public async Task WhenCheckBoxHelperCalled_ThenCorrectClassCalled()
        {
            var tagHelper = Substitute.For <IMockViewComponentHelper>();

            var componentTag = new AutoCompleteTagHelper(tagHelper)
            {
                Id                 = "id",
                AutoSelect         = true,
                ConfirmOnBlur      = true,
                CssNameSpace       = "",
                DefaultValue       = "",
                DisplayMenu        = "",
                Element            = "",
                FunctionName       = "",
                MinLength          = 1,
                ShowNoOptionsFound = true,
                Name               = "",
                Required           = true,
                ShowAllValues      = true,
                OnConfirm          = "",
                Source             = "",
                AdditionalClass    = ""
            };
            string id                 = componentTag.Id;
            bool   autoSelect         = componentTag.AutoSelect;
            bool   confirmOnBlur      = componentTag.ConfirmOnBlur;
            string cssNamespace       = componentTag.CssNameSpace;
            string defaultValue       = componentTag.DefaultValue;
            string displayMenu        = componentTag.DisplayMenu;
            string element            = componentTag.Element;
            string functionName       = componentTag.FunctionName;
            int    minLength          = componentTag.MinLength;
            bool   showNoOptionsFound = componentTag.ShowNoOptionsFound;
            string name               = componentTag.Name;
            bool   required           = componentTag.Required;
            bool   showAllValues      = componentTag.ShowAllValues;
            string onConfirm          = componentTag.OnConfirm;
            string source             = componentTag.Source;
            string additionalClass    = componentTag.AdditionalClass;

            await ViewComponentTestHelper.CallTagHelper("AutoComplete", tagHelper, componentTag);
        }
        public async Task WhenTextInputHelperCalled_ThenCorrectClassCalled()
        {
            var tagHelper = Substitute.For <IMockViewComponentHelper>();

            var componentTag = new TextInputTagHelper(tagHelper)
            {
                AdditionalClass = "AdditionalClass",
                ErrorMessage    = "ErrorMessage",
                HintText        = "HintText",
                HasError        = false,
                Id = "Id"
            };
            string id              = componentTag.Id;
            string hintText        = componentTag.HintText;
            string errorMessage    = componentTag.ErrorMessage;
            bool   hasError        = componentTag.HasError;
            string additionalClass = componentTag.AdditionalClass;

            await ViewComponentTestHelper.CallTagHelper("TextInput", tagHelper, componentTag);
        }
        public async Task WhenCheckBoxHelperCalled_ThenCorrectClassCalled()
        {
            var tagHelper = Substitute.For <IMockViewComponentHelper>();

            var componentTag = new CheckboxTagHelper(tagHelper)
            {
                AdditionalClass = "AdditionalClass",
                Checked         = true,
                Id    = "Id",
                Label = "Label",
                Name  = "Name",
                Value = "Value"
            };
            string additionalClass = componentTag.AdditionalClass;
            bool   isChecked       = componentTag.Checked;
            string id    = componentTag.Id;
            string label = componentTag.Label;
            string name  = componentTag.Name;
            string value = componentTag.Value;

            await ViewComponentTestHelper.CallTagHelper("Checkbox", tagHelper, componentTag);
        }