105 references to SelectSources
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (105)
Rendering\HtmlHelperSelectTest.cs (105)
64new SelectListItem { Text = SelectSources.ModelStateEntry.ToString() },
65new SelectListItem { Text = SelectSources.ModelStateEntryWithPrefix.ToString() },
66new SelectListItem { Text = SelectSources.ViewDataEntry.ToString() },
67new SelectListItem { Text = SelectSources.PropertyOfViewDataEntry.ToString() },
68new SelectListItem { Text = SelectSources.ViewDataEntryWithPrefix.ToString() },
69new SelectListItem { Text = SelectSources.PropertyOfViewDataEntryWithPrefix.ToString() },
70new SelectListItem { Text = SelectSources.ModelValue.ToString() },
71new SelectListItem { Text = SelectSources.PropertyOfModel.ToString() },
409var expectedHtml = GetExpectedSelectElement(SelectSources.ModelStateEntry, allowMultiple: false);
414SelectSources.ModelStateEntry,
415SelectSources.ModelStateEntry.ToString());
418SelectSources.ModelStateEntryWithPrefix,
419SelectSources.ModelStateEntryWithPrefix.ToString());
424["Property1"] = SelectSources.ViewDataEntry,
425["Prefix.Property1"] = SelectSources.ViewDataEntryWithPrefix,
426["Prefix"] = new ModelContainingSources { Property1 = SelectSources.PropertyOfViewDataEntry },
428viewData.Model = new ModelContainingSources { Property1 = SelectSources.PropertyOfModel };
445SelectSources.ModelStateEntryWithPrefix,
451SelectSources.ModelStateEntry,
452SelectSources.ModelStateEntry.ToString());
455SelectSources.ModelStateEntryWithPrefix,
456SelectSources.ModelStateEntryWithPrefix.ToString());
461["Property1"] = SelectSources.ViewDataEntry,
462["Prefix.Property1"] = SelectSources.ViewDataEntryWithPrefix,
463["Prefix"] = new ModelContainingSources { Property1 = SelectSources.PropertyOfViewDataEntry },
465viewData.Model = new ModelContainingSources { Property1 = SelectSources.PropertyOfModel };
482var expectedHtml = GetExpectedSelectElement(SelectSources.ViewDataEntry, allowMultiple: false);
487["Property1"] = SelectSources.ViewDataEntry,
488["Prefix.Property1"] = SelectSources.ViewDataEntryWithPrefix,
489["Prefix"] = new ModelContainingSources { Property1 = SelectSources.PropertyOfViewDataEntry },
491viewData.Model = new ModelContainingSources { Property1 = SelectSources.PropertyOfModel };
508SelectSources.ViewDataEntryWithPrefix,
514["Property1"] = SelectSources.ViewDataEntry,
515["Prefix.Property1"] = SelectSources.ViewDataEntryWithPrefix,
516["Prefix"] = new ModelContainingSources { Property1 = SelectSources.PropertyOfViewDataEntry },
518viewData.Model = new ModelContainingSources { Property1 = SelectSources.PropertyOfModel };
536SelectSources.PropertyOfViewDataEntry,
542["Property1"] = SelectSources.ViewDataEntry,
543["Prefix"] = new ModelContainingSources { Property1 = SelectSources.PropertyOfViewDataEntry },
545viewData.Model = new ModelContainingSources { Property1 = SelectSources.PropertyOfModel };
562var expectedHtml = GetExpectedSelectElement(SelectSources.PropertyOfModel, allowMultiple: false);
563var model = new ModelContainingSources { Property1 = SelectSources.PropertyOfModel };
578var expectedHtml = GetExpectedSelectElementWithPrefix(SelectSources.PropertyOfModel, allowMultiple: false);
579var model = new ModelContainingSources { Property1 = SelectSources.PropertyOfModel };
812var expectedHtml = GetExpectedSelectElement(SelectSources.ModelStateEntry, allowMultiple: true);
817SelectSources.ModelStateEntry,
818SelectSources.ModelStateEntry.ToString());
821SelectSources.ModelStateEntryWithPrefix,
822SelectSources.ModelStateEntryWithPrefix.ToString());
827["Property1"] = new[] { SelectSources.ViewDataEntry },
828["Prefix.Property1"] = new[] { SelectSources.ViewDataEntryWithPrefix },
829["Prefix"] = new ModelContainingListOfSources { Property1 = { SelectSources.PropertyOfViewDataEntry } },
831viewData.Model = new ModelContainingListOfSources { Property1 = { SelectSources.PropertyOfModel } };
848SelectSources.ModelStateEntryWithPrefix,
854SelectSources.ModelStateEntry,
855SelectSources.ModelStateEntry.ToString());
858SelectSources.ModelStateEntryWithPrefix,
859SelectSources.ModelStateEntryWithPrefix.ToString());
864["Property1"] = new[] { SelectSources.ViewDataEntry },
865["Prefix.Property1"] = new[] { SelectSources.ViewDataEntryWithPrefix },
866["Prefix"] = new ModelContainingListOfSources { Property1 = { SelectSources.PropertyOfViewDataEntry } },
868viewData.Model = new ModelContainingListOfSources { Property1 = { SelectSources.PropertyOfModel } };
885var expectedHtml = GetExpectedSelectElement(SelectSources.ViewDataEntry, allowMultiple: true);
890["Property1"] = new[] { SelectSources.ViewDataEntry },
891["Prefix.Property1"] = new[] { SelectSources.ViewDataEntryWithPrefix },
892["Prefix"] = new ModelContainingListOfSources { Property1 = { SelectSources.PropertyOfViewDataEntry } },
894viewData.Model = new ModelContainingListOfSources { Property1 = { SelectSources.PropertyOfModel } };
911SelectSources.ViewDataEntryWithPrefix,
917["Property1"] = new[] { SelectSources.ViewDataEntry },
918["Prefix.Property1"] = new[] { SelectSources.ViewDataEntryWithPrefix },
919["Prefix"] = new ModelContainingListOfSources { Property1 = { SelectSources.PropertyOfViewDataEntry } },
921viewData.Model = new ModelContainingListOfSources { Property1 = { SelectSources.PropertyOfModel } };
939SelectSources.PropertyOfViewDataEntry,
945["Property1"] = new[] { SelectSources.ViewDataEntry },
946["Prefix"] = new ModelContainingListOfSources { Property1 = { SelectSources.PropertyOfViewDataEntry } },
948viewData.Model = new ModelContainingListOfSources { Property1 = { SelectSources.PropertyOfModel } };
965var expectedHtml = GetExpectedSelectElement(SelectSources.PropertyOfModel, allowMultiple: true);
966var model = new ModelContainingListOfSources { Property1 = { SelectSources.PropertyOfModel } };
981var expectedHtml = GetExpectedSelectElementWithPrefix(SelectSources.PropertyOfModel, allowMultiple: true);
982var model = new ModelContainingListOfSources { Property1 = { SelectSources.PropertyOfModel } };
1507private static string GetExpectedSelectElement(SelectSources source, bool allowMultiple)
1511$"{ GetOption(SelectSources.ModelStateEntry, source) }{ Environment.NewLine }" +
1512$"{ GetOption(SelectSources.ModelStateEntryWithPrefix, source) }{ Environment.NewLine }" +
1513$"{ GetOption(SelectSources.ViewDataEntry, source) }{ Environment.NewLine }" +
1514$"{ GetOption(SelectSources.PropertyOfViewDataEntry, source) }{ Environment.NewLine }" +
1515$"{ GetOption(SelectSources.ViewDataEntryWithPrefix, source) }{ Environment.NewLine }" +
1516$"{ GetOption(SelectSources.PropertyOfViewDataEntryWithPrefix, source) }{ Environment.NewLine }" +
1517$"{ GetOption(SelectSources.ModelValue, source) }{ Environment.NewLine }" +
1518$"{ GetOption(SelectSources.PropertyOfModel, source) }{ Environment.NewLine }" +
1522private static string GetExpectedSelectElementWithPrefix(SelectSources source, bool allowMultiple)
1526$"{ GetOption(SelectSources.ModelStateEntry, source) }{ Environment.NewLine }" +
1527$"{ GetOption(SelectSources.ModelStateEntryWithPrefix, source) }{ Environment.NewLine }" +
1528$"{ GetOption(SelectSources.ViewDataEntry, source) }{ Environment.NewLine }" +
1529$"{ GetOption(SelectSources.PropertyOfViewDataEntry, source) }{ Environment.NewLine }" +
1530$"{ GetOption(SelectSources.ViewDataEntryWithPrefix, source) }{ Environment.NewLine }" +
1531$"{ GetOption(SelectSources.PropertyOfViewDataEntryWithPrefix, source) }{ Environment.NewLine }" +
1532$"{ GetOption(SelectSources.ModelValue, source) }{ Environment.NewLine }" +
1533$"{ GetOption(SelectSources.PropertyOfModel, source) }{ Environment.NewLine }" +
1542private static string GetOption(SelectSources optionSource, SelectSources source)
1547private static string GetSelected(SelectSources optionSource, SelectSources source)
1631public SelectSources Property1 { get; set; }
1636public List<SelectSources> Property1 { get; } = new List<SelectSources>();