Updating the global.json creation to use the IFile interface and adding a unit test to cover it.
This commit is contained in:
parent
f67a72d9c4
commit
822b290bb6
2 changed files with 17 additions and 5 deletions
|
@ -96,13 +96,13 @@ namespace Microsoft.DotNet.Configurer
|
|||
</packageSources>
|
||||
</configuration>");
|
||||
|
||||
File.WriteAllText(
|
||||
_file.WriteAllText(
|
||||
Path.Combine(workingDirectory, "global.json"),
|
||||
$@"{{
|
||||
""sdk"": {{
|
||||
""version"":""{Product.Version}""
|
||||
}}
|
||||
}}");
|
||||
""sdk"": {{
|
||||
""version"":""{Product.Version}""
|
||||
}}
|
||||
}}");
|
||||
|
||||
succeeded &= CreateTemporaryProject(workingDirectory, templateInfo);
|
||||
|
||||
|
|
|
@ -163,6 +163,18 @@ namespace Microsoft.DotNet.Configurer.UnitTests
|
|||
</configuration>");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void It_writes_a_global_json_file_with_the_current_cli_version()
|
||||
{
|
||||
var nugetConfigPath = Path.Combine(_temporaryDirectoryMock.DirectoryPath, "global.json");
|
||||
_fileSystemMock.File.ReadAllText(nugetConfigPath).Should().Be(
|
||||
$@"{{
|
||||
""sdk"": {{
|
||||
""version"":""{Product.Version}""
|
||||
}}
|
||||
}}");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void It_uses_a_config_file_with_dotnet_restore()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue