-
CodeBeam.MudExtensions.UnitTest.Viewer
+
CodeBeam.MudExtensions.UnitTests.Viewer
@@ -30,7 +30,7 @@
@code {
private bool collapseNavMenu = true;
- private string? NavMenuCssClass => collapseNavMenu ? "collapse" : null;
+ private string NavMenuCssClass => collapseNavMenu ? "collapse" : null;
private void ToggleNavMenu()
{
diff --git a/CodeBeam.MudExtensions.UnitTest.Viewer/Shared/NavMenu.razor.css b/CodeBeam.MudExtensions.UnitTests.Viewer/Shared/NavMenu.razor.css
similarity index 100%
rename from CodeBeam.MudExtensions.UnitTest.Viewer/Shared/NavMenu.razor.css
rename to CodeBeam.MudExtensions.UnitTests.Viewer/Shared/NavMenu.razor.css
diff --git a/CodeBeam.MudExtensions.UnitTest.Viewer/TestComponents/ListExtended/ListExperimentalCountTest.razor b/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/ListExtended/ListExperimentalCountTest.razor
similarity index 100%
rename from CodeBeam.MudExtensions.UnitTest.Viewer/TestComponents/ListExtended/ListExperimentalCountTest.razor
rename to CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/ListExtended/ListExperimentalCountTest.razor
diff --git a/CodeBeam.MudExtensions.UnitTest.Viewer/TestComponents/ListExtended/ListExperimentalEnhancedTest.razor b/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/ListExtended/ListExperimentalEnhancedTest.razor
similarity index 100%
rename from CodeBeam.MudExtensions.UnitTest.Viewer/TestComponents/ListExtended/ListExperimentalEnhancedTest.razor
rename to CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/ListExtended/ListExperimentalEnhancedTest.razor
diff --git a/CodeBeam.MudExtensions.UnitTest.Viewer/TestComponents/ListExtended/ListExperimentalSelectionInitialValueTest.razor b/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/ListExtended/ListExperimentalSelectionInitialValueTest.razor
similarity index 100%
rename from CodeBeam.MudExtensions.UnitTest.Viewer/TestComponents/ListExtended/ListExperimentalSelectionInitialValueTest.razor
rename to CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/ListExtended/ListExperimentalSelectionInitialValueTest.razor
diff --git a/CodeBeam.MudExtensions.UnitTest.Viewer/TestComponents/ListExtended/ListExperimentalSelectionTest.razor b/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/ListExtended/ListExperimentalSelectionTest.razor
similarity index 100%
rename from CodeBeam.MudExtensions.UnitTest.Viewer/TestComponents/ListExtended/ListExperimentalSelectionTest.razor
rename to CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/ListExtended/ListExperimentalSelectionTest.razor
diff --git a/CodeBeam.MudExtensions.UnitTest.Viewer/TestComponents/ListExtended/ListExperimentalVariantTest.razor b/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/ListExtended/ListExperimentalVariantTest.razor
similarity index 100%
rename from CodeBeam.MudExtensions.UnitTest.Viewer/TestComponents/ListExtended/ListExperimentalVariantTest.razor
rename to CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/ListExtended/ListExperimentalVariantTest.razor
diff --git a/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/MultiSelectCustomizedTextTest.razor b/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/MultiSelectCustomizedTextTest.razor
new file mode 100644
index 00000000..15782507
--- /dev/null
+++ b/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/MultiSelectCustomizedTextTest.razor
@@ -0,0 +1,45 @@
+@namespace CodeBeam.MudExtensions.UnitTests.TestComponents
+
+
+
+
+
+ @foreach (TestItem item in AllItems)
+ {
+
+ }
+
+
+@code {
+
+ private List
AllItems = new();
+ private HashSet SelectedItems = new();
+ protected override async Task OnInitializedAsync()
+ {
+ AllItems.Add(new TestItem { A = "FirstA" });
+ AllItems.Add(new TestItem { A = "SecondA" });
+ AllItems.Add(new TestItem { A = "ThirdA" });
+
+ SelectedItems.Add(AllItems[0]);
+ SelectedItems.Add(AllItems[1]);
+ await base.OnInitializedAsync();
+ }
+
+ private string ToString(TestItem x)
+ => x is null ? string.Empty : $"{x.A}";
+
+ private string GetMultiSelectionText(List selectedValues)
+ {
+ return $"Selected values: {string.Join(", ", selectedValues.Select(x => x.A))}";
+ }
+
+ private class TestItem
+ {
+ public string A { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/MultiSelectTest1.razor b/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/MultiSelectTest1.razor
new file mode 100644
index 00000000..02874bc6
--- /dev/null
+++ b/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/MultiSelectTest1.razor
@@ -0,0 +1,15 @@
+@namespace CodeBeam.MudExtensions.UnitTests.TestComponents
+
+
+
+ 1
+ 2
+ 3
+
+
+
+@code {
+ public static string __description__ = "Click should not close the menu and selecting multiple values should update the bindable value with a comma separated list.";
+
+ IEnumerable values = new HashSet();
+}
diff --git a/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/MultiSelectTest2.razor b/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/MultiSelectTest2.razor
new file mode 100644
index 00000000..e912b9fe
--- /dev/null
+++ b/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/MultiSelectTest2.razor
@@ -0,0 +1,27 @@
+@namespace CodeBeam.MudExtensions.UnitTests.TestComponents
+
+
+
+
+ @foreach (var item in AllItems)
+ {
+ @item
+ }
+
+
+@code {
+ public static string __description__ = "Test for the Select All option";
+ private List AllItems = new();
+ private IEnumerable SelectedItems = new HashSet();
+ protected override void OnInitialized()
+ {
+ AllItems.Add("FirstA");
+ AllItems.Add("SecondA");
+ AllItems.Add("ThirdA");
+ }
+}
\ No newline at end of file
diff --git a/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/MultiSelectTest3.razor b/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/MultiSelectTest3.razor
new file mode 100644
index 00000000..4332ec98
--- /dev/null
+++ b/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/MultiSelectTest3.razor
@@ -0,0 +1,35 @@
+@namespace CodeBeam.MudExtensions.UnitTests.TestComponents
+
+
+
+
+ MudSelect.Value: "@value"
+ Selected Values: "@string.Join(", ", options ?? new List())"
+
+
+
+ @foreach (var feline in felines)
+ {
+ @feline
+ }
+
+
+
+
+@code {
+ private string value { get; set; } = "Nothing selected";
+ private IEnumerable options { get; set; } = new HashSet() { "Lion" };
+
+ private string[] felines =
+ {
+ "Jaguar", "Leopard", "Lion", "Lynx", "Panther", "Puma", "Tiger"
+ };
+
+ private string GetMultiSelectionText(List selectedValues)
+ {
+ return $"{selectedValues.Count} feline{(selectedValues.Count > 1 ? "s have" : " has")} been selected";
+ }
+}
diff --git a/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/MultiSelectTest4.razor b/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/MultiSelectTest4.razor
new file mode 100644
index 00000000..2ec1a3f7
--- /dev/null
+++ b/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/MultiSelectTest4.razor
@@ -0,0 +1,34 @@
+@namespace CodeBeam.MudExtensions.UnitTests.TestComponents
+
+
+
+
+
+ @foreach (var feline in felines)
+ {
+ @feline
+ }
+
+
+
+ MudSelect.Value: "@value"
+
+
+
+@code {
+ private string value { get; set; } = "Nothing selected";
+ private IEnumerable options { get; set; }
+
+ private string[] felines =
+ {
+ "Jaguar", "Leopard", "Lion", "Lynx", "Panther", "Puma", "Tiger"
+ };
+
+ private string GetMultiSelectionText(List selectedValues)
+ {
+ return $"{selectedValues.Count} feline{(selectedValues.Count > 1 ? "s have" : " has")} been selected";
+ }
+}
diff --git a/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/MultiSelectTest5.razor b/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/MultiSelectTest5.razor
new file mode 100644
index 00000000..d013ebe0
--- /dev/null
+++ b/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/MultiSelectTest5.razor
@@ -0,0 +1,30 @@
+@namespace CodeBeam.MudExtensions.UnitTests.TestComponents
+
+@if (_posts != null)
+{
+
+ @foreach (var role in _posts)
+ {
+ @role
+ }
+
+}
+
+
+@code
+{
+ private IEnumerable SelectedValues { get; set; } = new HashSet()
+ {
+ "Programista", "test"
+ };
+
+ private HashSet _posts;
+
+ protected override void OnInitialized()
+ {
+ _posts = new HashSet
+ {
+ "Programista", "Programista 2", "test", "Technik", "Tester", "Tester tester"
+ };
+ }
+}
\ No newline at end of file
diff --git a/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/MultiSelectTestRequiredValue.razor b/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/MultiSelectTestRequiredValue.razor
new file mode 100644
index 00000000..6ee70709
--- /dev/null
+++ b/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/MultiSelectTestRequiredValue.razor
@@ -0,0 +1,42 @@
+@namespace CodeBeam.MudExtensions.UnitTests.TestComponents
+
+
+
+ 1
+ 2
+ 3
+
+
+
+ @foreach(var role in Roles)
+ {
+
+ }
+
+
+@code {
+
+ public static string __description__ = "Multi-Select Required Should Recognize Values";
+
+ string value=null;
+
+ public class TestClass
+ {
+ public string Name { get; set; }
+ public string NameTranslated { get; set; }
+ public override string ToString() => Name;
+ }
+
+
+ public List Roles {get; set; } = new();
+ public IEnumerable SelectedRoles = new List();
+
+ Func converter = p => p?.NameTranslated;
+
+ protected override void OnInitialized()
+ {
+ Roles.Add(new TestClass() { Name ="Admin", NameTranslated="Administrator"});
+ Roles.Add(new TestClass() { Name ="Customer", NameTranslated="Kunde"});
+ }
+
+}
diff --git a/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/MultiSelectTextTest.razor b/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/MultiSelectTextTest.razor
new file mode 100644
index 00000000..2cb9859c
--- /dev/null
+++ b/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/MultiSelectTextTest.razor
@@ -0,0 +1,19 @@
+@namespace CodeBeam.MudExtensions.UnitTests.TestComponents
+
+
+
+
+
+
+
+
+
+
+
+
+@code {
+
+
+}
\ No newline at end of file
diff --git a/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/MultiSelectWithCustomComparerTest.razor b/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/MultiSelectWithCustomComparerTest.razor
new file mode 100644
index 00000000..3f793936
--- /dev/null
+++ b/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/MultiSelectWithCustomComparerTest.razor
@@ -0,0 +1,52 @@
+@namespace CodeBeam.MudExtensions.UnitTests.TestComponents
+
+
+
+
+
+
+
+
+
+
+
+
+ Set Selection
+
+
+
+@code {
+ static CoffeeComparer Comparer { get; } = new();
+
+ HashSet Selected { get; } = new(Comparer);
+
+ void SelectedChanged(IEnumerable newSelected)
+ {
+ Selected.Clear();
+ Selected.UnionWith(newSelected);
+ }
+
+ void SetSelection()
+ {
+ Selected.Clear();
+ Selected.Add(new("lat", "Selected Cafe Latte"));
+ Selected.Add(new("esp", "Selected Espresso"));
+ }
+
+ class Coffee
+ {
+ public string Key { get; set; }
+ public string Name { get; set; }
+ public Coffee(string key, string name) { Key = key; Name = name; }
+ }
+
+ class CoffeeComparer : IEqualityComparer
+ {
+ public bool Equals(Coffee a, Coffee b) => a.Key == b.Key;
+ public int GetHashCode(Coffee x) => HashCode.Combine(x.Key);
+ }
+}
diff --git a/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/MultiSelectWithInitialValues.razor b/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/MultiSelectWithInitialValues.razor
new file mode 100644
index 00000000..9726e8ab
--- /dev/null
+++ b/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/MultiSelectWithInitialValues.razor
@@ -0,0 +1,38 @@
+@namespace CodeBeam.MudExtensions.UnitTests.TestComponents
+
+
+
+
+ @foreach (TestItem item in AllItems)
+ {
+
+ }
+
+
+@code {
+
+ private List AllItems = new();
+ private HashSet SelectedItems = new();
+ protected override async Task OnInitializedAsync()
+ {
+ AllItems.Add(new TestItem { A = "FirstA" });
+ AllItems.Add(new TestItem { A = "SecondA" });
+ AllItems.Add(new TestItem { A = "ThirdA" });
+
+ SelectedItems.Add(AllItems[0]);
+ SelectedItems.Add(AllItems[1]);
+ await base.OnInitializedAsync();
+ }
+
+ private string ToString(TestItem x)
+ => x is null ? string.Empty : $"{x.A}";
+
+ private class TestItem
+ {
+ public string A { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/ReloadSelectItemsTest.razor b/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/ReloadSelectItemsTest.razor
new file mode 100644
index 00000000..e0aa9ea1
--- /dev/null
+++ b/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/ReloadSelectItemsTest.razor
@@ -0,0 +1,54 @@
+@namespace CodeBeam.MudExtensions.UnitTests.TestComponents
+
+
+
+
+
+ @foreach (var state in states)
+ {
+ @state
+ }
+
+
+
+ MudSelect.Value: "@value"
+
+
+
+Load new states
+
+@code {
+ public static string __description__ = "After clicking 'load new states' selecting items should result in the correct values being selected.";
+ private string value { get; set; } = "Nothing selected";
+
+
+ List states2 = new List()
+ {
+ "Alabama", "Alaska", "American Samoa"
+ };
+
+ List states = new List()
+ {
+ "American Samoa", "Arizona",
+ "Arkansas", "California", "Colorado", "Connecticut",
+ "Delaware", "District of Columbia", "Federated States of Micronesia",
+ "Florida", "Georgia", "Guam", "Hawaii", "Idaho",
+ "Illinois", "Indiana", "Iowa", "Kansas", "Kentucky",
+ "Louisiana", "Maine", "Marshall Islands", "Maryland",
+ "Massachusetts", "Michigan", "Minnesota", "Mississippi",
+ "Missouri", "Montana", "Nebraska", "Nevada",
+ "New Hampshire", "New Jersey", "New Mexico", "New York",
+ "North Carolina", "North Dakota", "Northern Mariana Islands", "Ohio",
+ "Oklahoma", "Oregon", "Palau", "Pennsylvania", "Puerto Rico",
+ "Rhode Island", "South Carolina", "South Dakota", "Tennessee",
+ "Texas", "Utah", "Vermont", "Virgin Island", "Virginia",
+ "Washington", "West Virginia", "Wisconsin", "Wyoming"
+ };
+
+ void ChangeStates()
+ {
+ value = "Nothing selected";
+ states = states2;
+ }
+
+}
\ No newline at end of file
diff --git a/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/ReselectValueTest.razor b/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/ReselectValueTest.razor
new file mode 100644
index 00000000..1e088662
--- /dev/null
+++ b/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/ReselectValueTest.razor
@@ -0,0 +1,26 @@
+@namespace CodeBeam.MudExtensions.UnitTests.TestComponents
+
+
+
+
+
+ Apple
+ Orange
+
+
+ @fruit
+ @ChangeCount
+
+
+@code{
+ string fruit = "Apple";
+ public int ChangeCount { get; private set; }
+
+ void FruitChanged(IEnumerable fruits)
+ {
+ ChangeCount++;
+ }
+}
\ No newline at end of file
diff --git a/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/SelectClearableTest.razor b/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/SelectClearableTest.razor
new file mode 100644
index 00000000..9a4a17a8
--- /dev/null
+++ b/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/SelectClearableTest.razor
@@ -0,0 +1,21 @@
+@namespace CodeBeam.MudExtensions.UnitTests.TestComponents
+
+
+
+
+
+
+
+
+@code {
+ public static string __description__ = "Initially hidden clear button should show when item is selected.";
+
+ string value = null;
+
+ public bool ClearButtonClicked { get; set; }
+
+ private void ClearButtonClickHandler(MouseEventArgs e)
+ {
+ ClearButtonClicked = true;
+ }
+}
diff --git a/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/SelectEventCountTest.razor b/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/SelectEventCountTest.razor
new file mode 100644
index 00000000..5a0a9534
--- /dev/null
+++ b/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/SelectEventCountTest.razor
@@ -0,0 +1,62 @@
+@namespace MudExtensions.UnitTests.TestComponents
+
+
+
+
+
+
+
+
+
+@code {
+ [Parameter]
+ public bool MultiSelection { get; set; }
+
+ public int ValueChangeCount { get; set; }
+ public int ValuesChangeCount { get; set; }
+ public int ItemChangeCount { get; set; }
+ public int ItemsChangeCount { get; set; }
+
+ MudSelectExtended _select;
+ MudSelectItemExtended FirstItem { get; set; }
+ MudSelectItemExtended SecondItem { get; set; }
+ MudSelectItemExtended ThirdItem { get; set; }
+
+ //public void SetSelectedItem()
+ //{
+ // #pragma warning disable BL0005
+ // _select.SelectedItem = SecondItem;
+ //}
+
+ //public void SetSelectedItems()
+ //{
+ // _select.SelectedItems = new HashSet>() { SecondItem, ThirdItem };
+ // //StateHasChanged();
+ //}
+
+ //public void SetReverseSelectedItems()
+ //{
+ // _select.SelectedItems = new HashSet>() { ThirdItem, FirstItem };
+ // //StateHasChanged();
+ //}
+
+ private void ValueChanged()
+ {
+ ValueChangeCount++;
+ }
+
+ private void ValuesChanged()
+ {
+ ValuesChangeCount++;
+ }
+
+ private void ItemChanged()
+ {
+ ItemChangeCount++;
+ }
+
+ private void ItemsChanged()
+ {
+ ItemsChangeCount++;
+ }
+}
diff --git a/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/SelectInitialValueTest.razor b/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/SelectInitialValueTest.razor
new file mode 100644
index 00000000..fe338c37
--- /dev/null
+++ b/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/SelectInitialValueTest.razor
@@ -0,0 +1,20 @@
+@namespace CodeBeam.MudExtensions.UnitTests.TestComponents
+
+
+
+
+
+
+
+
+
+@code {
+ public static string __description__ = "Click should open the Menu and selecting a value should update the bindable value.";
+
+ [Parameter]
+ public string SelectedValue { get; set; }
+ [Parameter]
+ public IEnumerable SelectedValues { get; set; }
+ [Parameter]
+ public bool MultiSelection { get; set; }
+}
diff --git a/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/SelectOnCloseTest.razor b/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/SelectOnCloseTest.razor
new file mode 100644
index 00000000..a2498765
--- /dev/null
+++ b/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/SelectOnCloseTest.razor
@@ -0,0 +1,21 @@
+@namespace CodeBeam.MudExtensions.UnitTests.TestComponents
+
+
+
+
+
+
+
+
+selected: @Selected
+
+selected When OnClose: @SelectedWhenOnClose
+@code {
+ public string Selected { get; set; } = "";
+ public string SelectedWhenOnClose { get; set; } = "";
+
+ public void onClose()
+ {
+ SelectedWhenOnClose = Selected;
+ }
+}
diff --git a/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/SelectRequiredTest.razor b/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/SelectRequiredTest.razor
new file mode 100644
index 00000000..c81243fa
--- /dev/null
+++ b/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/SelectRequiredTest.razor
@@ -0,0 +1,16 @@
+@namespace CodeBeam.MudExtensions.UnitTests.TestComponents
+
+
+
+
+
+
+
+
+
+@code
+{
+ public static string __description__ = "The Select should not show required-error initially. The first (empty) item should.";
+
+ string value = null;
+}
\ No newline at end of file
diff --git a/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/SelectTest1.razor b/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/SelectTest1.razor
new file mode 100644
index 00000000..5da3a739
--- /dev/null
+++ b/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/SelectTest1.razor
@@ -0,0 +1,28 @@
+@namespace CodeBeam.MudExtensions.UnitTests.TestComponents
+
+
+
+
+
+
+
+
+
+
+
+@code {
+ public static string __description__ = "Click should open the Menu and selecting a value should update the bindable value.";
+
+ string value = null;
+ bool _focused = false;
+
+ private void Focused()
+ {
+ _focused = true;
+ }
+
+ private void Blurred()
+ {
+ _focused = false;
+ }
+}
diff --git a/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/SelectTest2.razor b/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/SelectTest2.razor
new file mode 100644
index 00000000..d23ed2ba
--- /dev/null
+++ b/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/SelectTest2.razor
@@ -0,0 +1,15 @@
+@namespace CodeBeam.MudExtensions.UnitTests.TestComponents
+
+
+
+
+
+
+
+
+
+@code {
+ public static string __description__ = "Value 2 should be selected initially and hilighted.";
+
+ string value="2";
+}
diff --git a/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/SelectTextValueTest.razor b/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/SelectTextValueTest.razor
new file mode 100644
index 00000000..6f45c257
--- /dev/null
+++ b/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/SelectTextValueTest.razor
@@ -0,0 +1,10 @@
+@namespace CodeBeam.MudExtensions.UnitTests.TestComponents
+
+
+
+
+
+
+@code {
+ public bool? _boolValue { get; set; } = true;
+}
\ No newline at end of file
diff --git a/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/SelectUnrepresentableValueTest.razor b/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/SelectUnrepresentableValueTest.razor
new file mode 100644
index 00000000..c5f55675
--- /dev/null
+++ b/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/SelectUnrepresentableValueTest.razor
@@ -0,0 +1,14 @@
+@namespace CodeBeam.MudExtensions.UnitTests.TestComponents
+
+
+
+ One
+ Two
+ Three
+
+
+@code {
+ public static string __description__ = "Initially, since the value is not in the list of options, it should be shown as text instead of render fragment.";
+
+ int value=17;
+}
diff --git a/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/SelectUnrepresentableValueTest2.razor b/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/SelectUnrepresentableValueTest2.razor
new file mode 100644
index 00000000..aa8a5c6f
--- /dev/null
+++ b/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/SelectUnrepresentableValueTest2.razor
@@ -0,0 +1,14 @@
+@namespace CodeBeam.MudExtensions.UnitTests.TestComponents
+
+
+
+
+
+
+
+
+@code {
+ public static string __description__ = "Don't show initial value which is not in list because of Strict=true.";
+
+ int value=17;
+}
diff --git a/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/SelectValidationDataAttrTest.razor b/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/SelectValidationDataAttrTest.razor
new file mode 100644
index 00000000..41e1afbb
--- /dev/null
+++ b/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/SelectValidationDataAttrTest.razor
@@ -0,0 +1,36 @@
+@using System.ComponentModel.DataAnnotations
+@using Microsoft.AspNetCore.Components.Forms
+@namespace CodeBeam.MudExtensions.UnitTests.TestComponents
+
+
+
+
+
+
+
+ @foreach (var v in metasyntacticVariable)
+ {
+ @v
+ }
+
+
+
+
+@code {
+ #pragma warning disable CS1998 // async without await
+ public static string __description__ = "Test use of data attributes accessible using `For` bound expression.";
+
+ class TestModel
+ {
+ [StringLength(3, ErrorMessage = "Should not be longer than 3")]
+ public string Value { get; set; }
+ }
+
+ private TestModel Model { get; set; } = new TestModel();
+
+ // What does this awkward var name means ? => https://en.wikipedia.org/wiki/Metasyntactic_variable
+ private string[] metasyntacticVariable =
+ {
+ "Foo", "Bar", "Qux", "Quux"
+ };
+}
\ No newline at end of file
diff --git a/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/SelectWithEnumTest.razor b/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/SelectWithEnumTest.razor
new file mode 100644
index 00000000..a8dbdd81
--- /dev/null
+++ b/CodeBeam.MudExtensions.UnitTests.Viewer/TestComponents/SelectExtended/SelectWithEnumTest.razor
@@ -0,0 +1,23 @@
+@namespace CodeBeam.MudExtensions.UnitTests.TestComponents
+
+
+Value: @Selected
+
+
+ @foreach (MyEnum item in Enum.GetValues(typeof(MyEnum)))
+ {
+ @item
+ }
+
+
+@code {
+ public static string __description__ = "Initial Text should be the enum's default value.";
+
+ public MyEnum Selected { get; set; }
+
+ public enum MyEnum
+ {
+ First,
+ Second,
+ }
+}
diff --git a/CodeBeam.MudExtensions.UnitTest.Viewer/_Imports.razor b/CodeBeam.MudExtensions.UnitTests.Viewer/_Imports.razor
similarity index 78%
rename from CodeBeam.MudExtensions.UnitTest.Viewer/_Imports.razor
rename to CodeBeam.MudExtensions.UnitTests.Viewer/_Imports.razor
index 131dad6e..f18e5c35 100644
--- a/CodeBeam.MudExtensions.UnitTest.Viewer/_Imports.razor
+++ b/CodeBeam.MudExtensions.UnitTests.Viewer/_Imports.razor
@@ -6,8 +6,8 @@
@using Microsoft.AspNetCore.Components.Web.Virtualization
@using Microsoft.AspNetCore.Components.WebAssembly.Http
@using Microsoft.JSInterop
-@using CodeBeam.MudExtensions.UnitTest.Viewer
-@using CodeBeam.MudExtensions.UnitTest.Viewer.Shared
+@using CodeBeam.MudExtensions.UnitTests.Viewer
+@using CodeBeam.MudExtensions.UnitTests.Viewer.Shared
@using MudBlazor
@using MudExtensions
diff --git a/CodeBeam.MudExtensions.UnitTest.Viewer/wwwroot/css/app.css b/CodeBeam.MudExtensions.UnitTests.Viewer/wwwroot/css/app.css
similarity index 100%
rename from CodeBeam.MudExtensions.UnitTest.Viewer/wwwroot/css/app.css
rename to CodeBeam.MudExtensions.UnitTests.Viewer/wwwroot/css/app.css
diff --git a/CodeBeam.MudExtensions.UnitTest.Viewer/wwwroot/css/bootstrap/bootstrap.min.css b/CodeBeam.MudExtensions.UnitTests.Viewer/wwwroot/css/bootstrap/bootstrap.min.css
similarity index 100%
rename from CodeBeam.MudExtensions.UnitTest.Viewer/wwwroot/css/bootstrap/bootstrap.min.css
rename to CodeBeam.MudExtensions.UnitTests.Viewer/wwwroot/css/bootstrap/bootstrap.min.css
diff --git a/CodeBeam.MudExtensions.UnitTest.Viewer/wwwroot/css/bootstrap/bootstrap.min.css.map b/CodeBeam.MudExtensions.UnitTests.Viewer/wwwroot/css/bootstrap/bootstrap.min.css.map
similarity index 100%
rename from CodeBeam.MudExtensions.UnitTest.Viewer/wwwroot/css/bootstrap/bootstrap.min.css.map
rename to CodeBeam.MudExtensions.UnitTests.Viewer/wwwroot/css/bootstrap/bootstrap.min.css.map
diff --git a/CodeBeam.MudExtensions.UnitTest.Viewer/wwwroot/css/open-iconic/FONT-LICENSE b/CodeBeam.MudExtensions.UnitTests.Viewer/wwwroot/css/open-iconic/FONT-LICENSE
similarity index 100%
rename from CodeBeam.MudExtensions.UnitTest.Viewer/wwwroot/css/open-iconic/FONT-LICENSE
rename to CodeBeam.MudExtensions.UnitTests.Viewer/wwwroot/css/open-iconic/FONT-LICENSE
diff --git a/CodeBeam.MudExtensions.UnitTest.Viewer/wwwroot/css/open-iconic/ICON-LICENSE b/CodeBeam.MudExtensions.UnitTests.Viewer/wwwroot/css/open-iconic/ICON-LICENSE
similarity index 100%
rename from CodeBeam.MudExtensions.UnitTest.Viewer/wwwroot/css/open-iconic/ICON-LICENSE
rename to CodeBeam.MudExtensions.UnitTests.Viewer/wwwroot/css/open-iconic/ICON-LICENSE
diff --git a/CodeBeam.MudExtensions.UnitTest.Viewer/wwwroot/css/open-iconic/README.md b/CodeBeam.MudExtensions.UnitTests.Viewer/wwwroot/css/open-iconic/README.md
similarity index 100%
rename from CodeBeam.MudExtensions.UnitTest.Viewer/wwwroot/css/open-iconic/README.md
rename to CodeBeam.MudExtensions.UnitTests.Viewer/wwwroot/css/open-iconic/README.md
diff --git a/CodeBeam.MudExtensions.UnitTest.Viewer/wwwroot/css/open-iconic/font/css/open-iconic-bootstrap.min.css b/CodeBeam.MudExtensions.UnitTests.Viewer/wwwroot/css/open-iconic/font/css/open-iconic-bootstrap.min.css
similarity index 100%
rename from CodeBeam.MudExtensions.UnitTest.Viewer/wwwroot/css/open-iconic/font/css/open-iconic-bootstrap.min.css
rename to CodeBeam.MudExtensions.UnitTests.Viewer/wwwroot/css/open-iconic/font/css/open-iconic-bootstrap.min.css
diff --git a/CodeBeam.MudExtensions.UnitTest.Viewer/wwwroot/css/open-iconic/font/fonts/open-iconic.eot b/CodeBeam.MudExtensions.UnitTests.Viewer/wwwroot/css/open-iconic/font/fonts/open-iconic.eot
similarity index 100%
rename from CodeBeam.MudExtensions.UnitTest.Viewer/wwwroot/css/open-iconic/font/fonts/open-iconic.eot
rename to CodeBeam.MudExtensions.UnitTests.Viewer/wwwroot/css/open-iconic/font/fonts/open-iconic.eot
diff --git a/CodeBeam.MudExtensions.UnitTest.Viewer/wwwroot/css/open-iconic/font/fonts/open-iconic.otf b/CodeBeam.MudExtensions.UnitTests.Viewer/wwwroot/css/open-iconic/font/fonts/open-iconic.otf
similarity index 100%
rename from CodeBeam.MudExtensions.UnitTest.Viewer/wwwroot/css/open-iconic/font/fonts/open-iconic.otf
rename to CodeBeam.MudExtensions.UnitTests.Viewer/wwwroot/css/open-iconic/font/fonts/open-iconic.otf
diff --git a/CodeBeam.MudExtensions.UnitTest.Viewer/wwwroot/css/open-iconic/font/fonts/open-iconic.svg b/CodeBeam.MudExtensions.UnitTests.Viewer/wwwroot/css/open-iconic/font/fonts/open-iconic.svg
similarity index 100%
rename from CodeBeam.MudExtensions.UnitTest.Viewer/wwwroot/css/open-iconic/font/fonts/open-iconic.svg
rename to CodeBeam.MudExtensions.UnitTests.Viewer/wwwroot/css/open-iconic/font/fonts/open-iconic.svg
diff --git a/CodeBeam.MudExtensions.UnitTest.Viewer/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf b/CodeBeam.MudExtensions.UnitTests.Viewer/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf
similarity index 100%
rename from CodeBeam.MudExtensions.UnitTest.Viewer/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf
rename to CodeBeam.MudExtensions.UnitTests.Viewer/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf
diff --git a/CodeBeam.MudExtensions.UnitTest.Viewer/wwwroot/css/open-iconic/font/fonts/open-iconic.woff b/CodeBeam.MudExtensions.UnitTests.Viewer/wwwroot/css/open-iconic/font/fonts/open-iconic.woff
similarity index 100%
rename from CodeBeam.MudExtensions.UnitTest.Viewer/wwwroot/css/open-iconic/font/fonts/open-iconic.woff
rename to CodeBeam.MudExtensions.UnitTests.Viewer/wwwroot/css/open-iconic/font/fonts/open-iconic.woff
diff --git a/CodeBeam.MudExtensions.UnitTest.Viewer/wwwroot/favicon.png b/CodeBeam.MudExtensions.UnitTests.Viewer/wwwroot/favicon.png
similarity index 100%
rename from CodeBeam.MudExtensions.UnitTest.Viewer/wwwroot/favicon.png
rename to CodeBeam.MudExtensions.UnitTests.Viewer/wwwroot/favicon.png
diff --git a/CodeBeam.MudExtensions.UnitTest.Viewer/wwwroot/icon-192.png b/CodeBeam.MudExtensions.UnitTests.Viewer/wwwroot/icon-192.png
similarity index 100%
rename from CodeBeam.MudExtensions.UnitTest.Viewer/wwwroot/icon-192.png
rename to CodeBeam.MudExtensions.UnitTests.Viewer/wwwroot/icon-192.png
diff --git a/CodeBeam.MudExtensions.UnitTest.Viewer/wwwroot/index.html b/CodeBeam.MudExtensions.UnitTests.Viewer/wwwroot/index.html
similarity index 65%
rename from CodeBeam.MudExtensions.UnitTest.Viewer/wwwroot/index.html
rename to CodeBeam.MudExtensions.UnitTests.Viewer/wwwroot/index.html
index b5faf62f..dbc2a64b 100644
--- a/CodeBeam.MudExtensions.UnitTest.Viewer/wwwroot/index.html
+++ b/CodeBeam.MudExtensions.UnitTests.Viewer/wwwroot/index.html
@@ -4,12 +4,14 @@
- CodeBeam.MudExtensions.UnitTest.Viewer
+ CodeBeam.MudExtensions.UnitTests.Viewer
-
+
+
+
@@ -27,6 +29,8 @@
🗙