Skip to content

Commit

Permalink
Added suggestions test w/o parent dir
Browse files Browse the repository at this point in the history
  • Loading branch information
IngvarX committed Apr 4, 2021
1 parent 573a692 commit d8180ee
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/Camelot.Services.Tests/SuggestionsServiceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,21 @@ public void TestSorting()
Assert.Equal(NotFavouriteDirectory, suggestions[2].FullPath);
}

[Fact]
public void TestNoParent()
{
_autoMocker
.Setup<IFavouriteDirectoriesService, ISet<string>>(m => m.FavouriteDirectories)
.Returns(new HashSet<string> {FavouriteDirectory});

var service = _autoMocker.CreateInstance<SuggestionsService>();
var suggestions = service.GetSuggestions(Substring).ToArray();

Assert.NotEmpty(suggestions);
Assert.Single(suggestions);
Assert.Equal(FavouriteDirectory, suggestions.Single().FullPath);
}

private static SuggestionsConfiguration GetConfiguration() =>
new SuggestionsConfiguration
{
Expand Down

0 comments on commit d8180ee

Please sign in to comment.