Fixing dotnet-compile and dotnet-test unit tests. Also, fixing a potential NullRef in ProjectContext.
The compile unit test needed to be updated to mock out a new call to ICommand.WorkingDirectory. The test unit test needed to account for build-base-path getting fully qualified.
This commit is contained in:
parent
6249829e68
commit
d52ea07934
3 changed files with 3 additions and 2 deletions
|
@ -36,7 +36,7 @@ namespace Microsoft.DotNet.ProjectModel
|
||||||
|
|
||||||
public string RootDirectory => GlobalSettings?.DirectoryPath;
|
public string RootDirectory => GlobalSettings?.DirectoryPath;
|
||||||
|
|
||||||
public string ProjectDirectory => ProjectFile.ProjectDirectory;
|
public string ProjectDirectory => ProjectFile?.ProjectDirectory;
|
||||||
|
|
||||||
public string PackagesDirectory { get; }
|
public string PackagesDirectory { get; }
|
||||||
|
|
||||||
|
|
|
@ -176,6 +176,7 @@ namespace Microsoft.DotNet.Tools.Compiler.Tests
|
||||||
var projectJson = Path.Combine(TestAssetPath, "project.json");
|
var projectJson = Path.Combine(TestAssetPath, "project.json");
|
||||||
var command = new Mock<ICommand>();
|
var command = new Mock<ICommand>();
|
||||||
command.Setup(c => c.Execute()).Returns(new CommandResult());
|
command.Setup(c => c.Execute()).Returns(new CommandResult());
|
||||||
|
command.Setup(c => c.WorkingDirectory(It.IsAny<string>())).Returns(() => command.Object);
|
||||||
command.Setup(c => c.OnErrorLine(It.IsAny<Action<string>>())).Returns(() => command.Object);
|
command.Setup(c => c.OnErrorLine(It.IsAny<Action<string>>())).Returns(() => command.Object);
|
||||||
command.Setup(c => c.OnOutputLine(It.IsAny<Action<string>>())).Returns(() => command.Object);
|
command.Setup(c => c.OnOutputLine(It.IsAny<Action<string>>())).Returns(() => command.Object);
|
||||||
var commandFactory = new Mock<ICommandFactory>();
|
var commandFactory = new Mock<ICommandFactory>();
|
||||||
|
|
|
@ -141,7 +141,7 @@ namespace Microsoft.Dotnet.Tools.Test.Tests
|
||||||
[Fact]
|
[Fact]
|
||||||
public void It_sets_BuildBasePath_when_one_is_passed_in()
|
public void It_sets_BuildBasePath_when_one_is_passed_in()
|
||||||
{
|
{
|
||||||
_dotnetTestFullParams.BuildBasePath.Should().Be(BuildBasePath);
|
_dotnetTestFullParams.BuildBasePath.Should().Be(Path.GetFullPath(BuildBasePath));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue