diff --git a/MCTG/ConsoleApp/Menu/Entry.cs b/MCTG/ConsoleApp/Menu/Entry.cs index 6c63792..3a84fff 100644 --- a/MCTG/ConsoleApp/Menu/Entry.cs +++ b/MCTG/ConsoleApp/Menu/Entry.cs @@ -56,7 +56,7 @@ namespace ConsoleApp.Menu if (cki.Key == ConsoleKey.Escape) { if (CurrentSelected is null) - throw new ArgumentNullException("Error: CurrentSelected is null."); + throw new ArgumentNullException("CurrentSelected"); CurrentSelected.Input = InputStr.ToString(); DisableWriteMode(); diff --git a/MCTG/ConsoleApp/Menu/Menu.cs b/MCTG/ConsoleApp/Menu/Menu.cs index d556397..68962db 100644 --- a/MCTG/ConsoleApp/Menu/Menu.cs +++ b/MCTG/ConsoleApp/Menu/Menu.cs @@ -96,7 +96,7 @@ namespace ConsoleApp.Menu public virtual IMenu? Return() { if (CurrentSelected is null) - throw new ArgumentNullException("Error: CurrentSelected is null."); + throw new ArgumentNullException("CurrentSelected"); return (IMenu)CurrentSelected; } @@ -104,7 +104,7 @@ namespace ConsoleApp.Menu protected virtual List> SearchInSelection() { if (_allSelectors is null) - throw new ArgumentNullException("Error: _allSelector is null."); + throw new ArgumentNullException("_allSelectors"); return _allSelectors.FindAll(x => x.Line.ToLower().Contains(InputStr.ToString().ToLower())); diff --git a/MCTG/ConsoleApp/Menu/PlainText.cs b/MCTG/ConsoleApp/Menu/PlainText.cs index 5ad4fa9..d5deee1 100644 --- a/MCTG/ConsoleApp/Menu/PlainText.cs +++ b/MCTG/ConsoleApp/Menu/PlainText.cs @@ -34,13 +34,35 @@ namespace ConsoleApp.Menu public bool WriteMode { get; set; } public StringBuilder InputStr { get; set; } - public void DisableWriteMode() { } - public void EnableWriteMode() { } - public void SelectNext() { } - public void SelectPrevious() { } - public void ToggleWriteMode() { } - public void Update() { } - public void WriteMenuMode(ConsoleKeyInfo cki) { } + + public void DisableWriteMode() + { + // Plain text does not need to do anything for this. + } + public void EnableWriteMode() + { + // Plain text does not need to do anything for this. + } + public void SelectNext() + { + // Plain text does not need to do anything for this. + } + public void SelectPrevious() + { + // Plain text does not need to do anything for this. + } + public void ToggleWriteMode() + { + // Plain text does not need to do anything for this. + } + public void Update() + { + // Plain text does not need to do anything for this. + } + public void WriteMenuMode(ConsoleKeyInfo cki) + { + // Plain text does not need to do anything for this. + } #endregion } } diff --git a/MCTG/ConsoleApp/Menu/SearcherRecipe.cs b/MCTG/ConsoleApp/Menu/SearcherRecipe.cs index af362f9..b7dea49 100644 --- a/MCTG/ConsoleApp/Menu/SearcherRecipe.cs +++ b/MCTG/ConsoleApp/Menu/SearcherRecipe.cs @@ -37,7 +37,7 @@ namespace ConsoleApp.Menu public override IMenu? Return() { if (CurrentSelected == null) - throw new ArgumentNullException("Error: CurrentSelected is null."); + throw new ArgumentNullException("CurrentSelected"); return new PlainText(CurrentSelected.ToString()); } diff --git a/MCTG/ConsoleApp/Program.cs b/MCTG/ConsoleApp/Program.cs index eb526f6..a60cdcd 100644 --- a/MCTG/ConsoleApp/Program.cs +++ b/MCTG/ConsoleApp/Program.cs @@ -11,9 +11,7 @@ Console.WriteLine("Hello, World!\n\n"); // TESTS: -Stub stub = new Stub(); - -List recipeCollections = stub.LoadRecipeCollection(); +List recipeCollections = Stub.LoadRecipeCollection(); RecipeCollection? allRecipe = recipeCollections.Find(x => x.Description.Equals("All")); if (allRecipe == null) diff --git a/MCTG/ConsoleApp/Stubs/Stub.cs b/MCTG/ConsoleApp/Stubs/Stub.cs index 6824430..689a013 100644 --- a/MCTG/ConsoleApp/Stubs/Stub.cs +++ b/MCTG/ConsoleApp/Stubs/Stub.cs @@ -67,7 +67,7 @@ namespace ConsoleApp return stub; } - public List LoadRecipeCollection() + public static List LoadRecipeCollection() { List stub = new List(); stub.AddRange(new[]