fix sonar issues bis :)
continuous-integration/drone/push Build is passing Details

pull/38/head
Alexandre AGOSTINHO 2 years ago
parent 1948c8e579
commit 30cd623229

@ -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();

@ -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<Selector<T>> 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()));

@ -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
}
}

@ -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());
}

@ -11,9 +11,7 @@ Console.WriteLine("Hello, World!\n\n");
// TESTS:
Stub stub = new Stub();
List<RecipeCollection> recipeCollections = stub.LoadRecipeCollection();
List<RecipeCollection> recipeCollections = Stub.LoadRecipeCollection();
RecipeCollection? allRecipe = recipeCollections.Find(x => x.Description.Equals("All"));
if (allRecipe == null)

@ -67,7 +67,7 @@ namespace ConsoleApp
return stub;
}
public List<RecipeCollection> LoadRecipeCollection()
public static List<RecipeCollection> LoadRecipeCollection()
{
List<RecipeCollection> stub = new List<RecipeCollection>();
stub.AddRange(new[]

Loading…
Cancel
Save