From d8180ee3d447bc6a79a2b77b56e74884e993249e Mon Sep 17 00:00:00 2001 From: IngvarX Date: Sun, 4 Apr 2021 17:17:51 +0300 Subject: [PATCH] Added suggestions test w/o parent dir --- .../SuggestionsServiceTests.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/Camelot.Services.Tests/SuggestionsServiceTests.cs b/tests/Camelot.Services.Tests/SuggestionsServiceTests.cs index 9c4a0275..8e622c5c 100644 --- a/tests/Camelot.Services.Tests/SuggestionsServiceTests.cs +++ b/tests/Camelot.Services.Tests/SuggestionsServiceTests.cs @@ -125,6 +125,21 @@ public void TestSorting() Assert.Equal(NotFavouriteDirectory, suggestions[2].FullPath); } + [Fact] + public void TestNoParent() + { + _autoMocker + .Setup>(m => m.FavouriteDirectories) + .Returns(new HashSet {FavouriteDirectory}); + + var service = _autoMocker.CreateInstance(); + var suggestions = service.GetSuggestions(Substring).ToArray(); + + Assert.NotEmpty(suggestions); + Assert.Single(suggestions); + Assert.Equal(FavouriteDirectory, suggestions.Single().FullPath); + } + private static SuggestionsConfiguration GetConfiguration() => new SuggestionsConfiguration {