parent
6694ceb407
commit
aca3b3bacc
2 changed files with 12 additions and 6 deletions
|
|
@ -46,6 +46,8 @@ internal sealed class SdkNuGetTests
|
||||||
var output = await project.RunAsync("dotnet", "build");
|
var output = await project.RunAsync("dotnet", "build");
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
|
Console.WriteLine(output.StdOut);
|
||||||
|
Console.WriteLine(output.StdErr);
|
||||||
await Assert.That(output.ExitCode).IsZero();
|
await Assert.That(output.ExitCode).IsZero();
|
||||||
await Assert.That(project.File("bin", "Debug", "net10.0", "project.dll")).Exists();
|
await Assert.That(project.File("bin", "Debug", "net10.0", "project.dll")).Exists();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,20 +6,24 @@ namespace Geekeey.Arcade.NET.Tests.Shared;
|
||||||
internal sealed class Project : IDisposable
|
internal sealed class Project : IDisposable
|
||||||
{
|
{
|
||||||
private readonly DirectoryInfo _root;
|
private readonly DirectoryInfo _root;
|
||||||
|
private readonly DirectoryInfo _source;
|
||||||
|
private readonly DirectoryInfo _packages;
|
||||||
private readonly Command _shell;
|
private readonly Command _shell;
|
||||||
|
|
||||||
public Project(DirectoryInfo root)
|
public Project(DirectoryInfo root)
|
||||||
{
|
{
|
||||||
_root = root;
|
_root = root;
|
||||||
_shell = Command.WithWorkingDirectory(_root.FullName)
|
_source = _root.CreateSubdirectory("src");
|
||||||
|
_packages = _root.CreateSubdirectory("packages");
|
||||||
|
_shell = Command.WithWorkingDirectory(_source.FullName)
|
||||||
.WithEnvironment("DOTNET_CLI_DO_NOT_USE_MSBUILD_SERVER", "1")
|
.WithEnvironment("DOTNET_CLI_DO_NOT_USE_MSBUILD_SERVER", "1")
|
||||||
.WithEnvironment("TUNIT_DISABLE_GITHUB_REPORTER", "true")
|
.WithEnvironment("TUNIT_DISABLE_GITHUB_REPORTER", "true")
|
||||||
.WithEnvironment("NUGET_PACKAGES", System.IO.Path.Combine(_root.FullName, "packages"));
|
.WithEnvironment("NUGET_PACKAGES", _packages.FullName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Path
|
public string Path
|
||||||
{
|
{
|
||||||
get => _root.FullName;
|
get => _source.FullName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Task<CommandOutput> RunAsync(string exe, params IReadOnlyList<string> args)
|
public Task<CommandOutput> RunAsync(string exe, params IReadOnlyList<string> args)
|
||||||
|
|
@ -29,17 +33,17 @@ internal sealed class Project : IDisposable
|
||||||
|
|
||||||
public void CopyFrom(string path)
|
public void CopyFrom(string path)
|
||||||
{
|
{
|
||||||
System.IO.Directory.Copy(path, _root.FullName);
|
System.IO.Directory.Copy(path, _source.FullName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public FileInfo File(params IReadOnlyList<string> path)
|
public FileInfo File(params IReadOnlyList<string> path)
|
||||||
{
|
{
|
||||||
return new FileInfo(System.IO.Path.Combine([_root.FullName, .. path]));
|
return new FileInfo(System.IO.Path.Combine([_source.FullName, .. path]));
|
||||||
}
|
}
|
||||||
|
|
||||||
public DirectoryInfo Directory(params IReadOnlyList<string> path)
|
public DirectoryInfo Directory(params IReadOnlyList<string> path)
|
||||||
{
|
{
|
||||||
return new DirectoryInfo(System.IO.Path.Combine([_root.FullName, .. path]));
|
return new DirectoryInfo(System.IO.Path.Combine([_source.FullName, .. path]));
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task Template(string path, string from, string insert)
|
public async Task Template(string path, string from, string insert)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue