2016-02-25 00:05:55 +00:00
|
|
|
// Copyright (c) .NET Foundation and contributors. All rights reserved.
|
|
|
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
|
|
|
|
|
|
using System;
|
|
|
|
using System.IO;
|
|
|
|
|
|
|
|
namespace Microsoft.DotNet.Cli.Utils.Tests
|
|
|
|
{
|
|
|
|
public static class CommandResolverTestUtils
|
|
|
|
{
|
2016-03-07 19:50:52 +00:00
|
|
|
public static string CreateNonRunnableTestCommand(string directory, string filename, string extension=".dll")
|
2016-02-25 00:05:55 +00:00
|
|
|
{
|
|
|
|
Directory.CreateDirectory(directory);
|
|
|
|
|
|
|
|
var filePath = Path.Combine(directory, filename + extension);
|
|
|
|
|
|
|
|
File.WriteAllText(filePath, "test command that does nothing.");
|
2016-03-07 19:50:52 +00:00
|
|
|
|
|
|
|
return filePath;
|
2016-02-25 00:05:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public static IEnvironmentProvider SetupEnvironmentProviderWhichFindsExtensions(params string[] extensions)
|
|
|
|
{
|
|
|
|
return new EnvironmentProvider(extensions);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|