Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sensslen committed Feb 26, 2024
1 parent ed567ad commit 68b23f7
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public void SetUp()
public void GetProjects_Should_ReturnProjectsAsListDirectly(string projectFile)
{
IEnumerable<string> result = _uut.GetProjects(projectFile);
CollectionAssert.AreEqual(new[] { projectFile }, result);
CollectionAssert.AreEqual(new[] { Path.GetFullPath(projectFile) }, result);
_msBuild.DidNotReceive().GetProjectsFromSolution(Arg.Any<string>());
}

Expand All @@ -42,7 +42,7 @@ public void GetProjects_Should_QueryMsBuildToGetProjectsForSolutionFiles(string
{
_ = _uut.GetProjects(solutionFile);

_msBuild.Received(1).GetProjectsFromSolution(solutionFile);
_msBuild.Received(1).GetProjectsFromSolution(Path.GetFullPath(solutionFile));
}

[TestCase("A.sln")]
Expand All @@ -55,7 +55,7 @@ public void GetProjects_Should_ReturnEmptyArray_If_SolutionContainsNoProjects(st
IEnumerable<string> result = _uut.GetProjects(solutionFile);
CollectionAssert.AreEqual(Array.Empty<string>(), result);

_msBuild.Received(1).GetProjectsFromSolution(solutionFile);
_msBuild.Received(1).GetProjectsFromSolution(Path.GetFullPath(solutionFile));
}

[TestCase("A.sln")]
Expand All @@ -69,7 +69,7 @@ public void GetProjects_Should_ReturnEmptyArray_If_SolutionContainsProjectsThatD
IEnumerable<string> result = _uut.GetProjects(solutionFile);
CollectionAssert.AreEqual(Array.Empty<string>(), result);

_msBuild.Received(1).GetProjectsFromSolution(solutionFile);
_msBuild.Received(1).GetProjectsFromSolution(Path.GetFullPath(solutionFile));
}

[TestCase("A.sln")]
Expand All @@ -82,9 +82,9 @@ public void GetProjects_Should_ReturnArrayOfProjects_If_SolutionContainsProjects
_msBuild.GetProjectsFromSolution(Arg.Any<string>()).Returns(projects);

IEnumerable<string> result = _uut.GetProjects(solutionFile);
CollectionAssert.AreEqual(projects, result);
CollectionAssert.AreEqual(projects.Select(Path.GetFullPath), result);

_msBuild.Received(1).GetProjectsFromSolution(solutionFile);
_msBuild.Received(1).GetProjectsFromSolution(Path.GetFullPath(solutionFile));
}

[TestCase("A.sln")]
Expand All @@ -101,9 +101,9 @@ public void GetProjects_Should_ReturnOnlyExistingProjectsInSolutionFile(string s
.Returns(existingProjects.Concat(missingProjects).Shuffle(54321));

IEnumerable<string> result = _uut.GetProjects(solutionFile);
CollectionAssert.AreEquivalent(existingProjects, result);
CollectionAssert.AreEquivalent(existingProjects.Select(Path.GetFullPath), result);

_msBuild.Received(1).GetProjectsFromSolution(solutionFile);
_msBuild.Received(1).GetProjectsFromSolution(Path.GetFullPath(solutionFile));
}

[Test]
Expand Down

0 comments on commit 68b23f7

Please sign in to comment.