Skip to content

Commit

Permalink
Fixed test for UNIX based systems.
Browse files Browse the repository at this point in the history
  • Loading branch information
azchohfi committed Apr 10, 2021
1 parent db62cce commit 801c856
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,17 @@ public void DiscoverTestsShouldLogIfTheSourceDoesNotExist()
public void DiscoverTestsShouldLogIfTheSourceDoesNotExistIfItHasAPackage()
{
var criteria = new DiscoveryCriteria(new List<string> { "imaginary.exe" }, 100, null);
criteria.Package = @"c:\abc\recipe.AppxRecipe";

var packageName = "recipe.AppxRecipe";

var fakeDirectory = Directory.GetDirectoryRoot(typeof(DiscoveryManagerTests).GetTypeInfo().Assembly.Location);

criteria.Package = Path.Combine(fakeDirectory, Path.Combine(packageName));
var mockLogger = new Mock<ITestDiscoveryEventsHandler2>();

this.discoveryManager.DiscoverTests(criteria, mockLogger.Object);

var errorMessage = string.Format(CultureInfo.CurrentCulture, "Could not find file {0}.", @"c:\abc\imaginary.exe");
var errorMessage = string.Format(CultureInfo.CurrentCulture, "Could not find file {0}.", Path.Combine(fakeDirectory, "imaginary.exe"));
mockLogger.Verify(
l =>
l.HandleLogMessage(
Expand Down

0 comments on commit 801c856

Please sign in to comment.