23 lines
719 B
C#
23 lines
719 B
C#
using Explorer.Application;
|
|
|
|
namespace Explorer.Application.Tests;
|
|
|
|
public class NotepadPlusPlusLocatorTests
|
|
{
|
|
[Fact]
|
|
public void Finds_notepad_plus_plus_on_PATH()
|
|
{
|
|
var found = NotepadPlusPlusLocator.Find(
|
|
fileExists: p => p.Equals(@"D:\apps\notepad++.exe", StringComparison.OrdinalIgnoreCase),
|
|
pathVariable: @"C:\Windows;D:\apps");
|
|
Assert.Equal(@"D:\apps\notepad++.exe", found);
|
|
}
|
|
|
|
[Fact]
|
|
public void Returns_null_when_missing()
|
|
{
|
|
Assert.Null(NotepadPlusPlusLocator.Find(fileExists: _ => false, pathVariable: @"C:\none"));
|
|
Assert.Contains("Notepad++", NotepadPlusPlusLocator.MissingHint, StringComparison.OrdinalIgnoreCase);
|
|
}
|
|
}
|