make things work again

fix

Tests Passing

cleanup

fix

fix
This commit is contained in:
Bryan Thornbury 2016-03-03 15:31:04 -08:00
parent 42cc39252e
commit b813e2b849
14 changed files with 163 additions and 635 deletions

View file

@ -40,160 +40,5 @@ namespace Microsoft.DotNet.Cli.Utils.Tests
typeof(PathCommandResolver)
});
}
// [Fact]
// public void It_Resolves_Rooted_Commands_Correctly()
// {
// var path = Path.Combine(AppContext.BaseDirectory, "rooteddir");
// Directory.CreateDirectory(path);
// var testCommandPath = CreateTestCommandFile(path, ".dll", "scriptrootedcommand");
// var scriptCommandResolver = new ScriptCommandResolver();
// var commandResolverArgs = new CommandResolverArguments
// {
// CommandName = testCommandPath,
// CommandArguments = new string[] {}
// };
// var commandSpec = scriptCommandResolver.Resolve(commandResolverArgs);
// commandSpec.Should().NotBeNull();
// commandSpec.Path.Should().Be(testCommandPath);
// commandSpec.ResolutionStrategy.Should().Be(CommandResolutionStrategy.RootedPath);
// }
// [Fact]
// public void It_Resolves_AppBase_Commands_Correctly()
// {
// var testCommandPath = CreateTestCommandFile(AppContext.BaseDirectory, ".exe", "scriptappbasecommand");
// var testCommandName = Path.GetFileNameWithoutExtension(testCommandPath);
// var scriptCommandResolver = new ScriptCommandResolver();
// var commandResolverArgs = new CommandResolverArguments
// {
// CommandName = testCommandName,
// CommandArguments = new string[] {},
// Environment = new EnvironmentProvider()
// };
// var commandSpec = scriptCommandResolver.Resolve(commandResolverArgs);
// commandSpec.Should().NotBeNull();
// commandSpec.Path.Should().Be(testCommandPath);
// commandSpec.ResolutionStrategy.Should().Be(CommandResolutionStrategy.BaseDirectory);
// }
// [Fact]
// public void It_Resolves_PATH_Commands_Correctly()
// {
// var path = Path.Combine(AppContext.BaseDirectory, "pathdir");
// var testCommandPath = CreateTestCommandFile(path, ".dll", "scriptpathcommmand");
// var testCommandName = Path.GetFileNameWithoutExtension(testCommandPath);
// Mock<IEnvironmentProvider> mockEnvironment = new Mock<IEnvironmentProvider>();
// mockEnvironment.Setup(c => c
// .GetCommandPath(It.IsAny<string>(), It.IsAny<string[]>()))
// .Returns(testCommandPath);
// var scriptCommandResolver = new ScriptCommandResolver();
// var commandResolverArgs = new CommandResolverArguments
// {
// CommandName = testCommandName,
// CommandArguments = new string[] {},
// Environment = mockEnvironment.Object
// };
// var commandSpec = scriptCommandResolver.Resolve(commandResolverArgs);
// commandSpec.Should().NotBeNull();
// commandSpec.Path.Should().Be(testCommandPath);
// commandSpec.ResolutionStrategy.Should().Be(CommandResolutionStrategy.Path);
// }
// [Fact]
// public void It_does_NOT_Resolve_Project_Tools_Commands()
// {
// var testAppPath = Path.Combine(AppContext.BaseDirectory,
// "TestAssets/TestProjects/AppWithToolDependency");
// var scriptCommandResolver = new ScriptCommandResolver();
// var commandResolverArgs = new CommandResolverArguments
// {
// CommandName = "dotnet-hello",
// CommandArguments = new string[] {},
// ProjectDirectory = testAppPath,
// Environment = new EnvironmentProvider()
// };
// var commandSpec = scriptCommandResolver.Resolve(commandResolverArgs);
// commandSpec.Should().BeNull();
// }
// [Fact]
// public void It_does_NOT_Resolve_Project_Dependencies_Commands()
// {
// var testAppPath = Path.Combine(AppContext.BaseDirectory,
// "TestAssets/TestProjects/AppWithDirectDependency");
// var scriptCommandResolver = new ScriptCommandResolver();
// var commandResolverArgs = new CommandResolverArguments
// {
// CommandName = "dotnet-hello",
// CommandArguments = new string[] {},
// ProjectDirectory = testAppPath,
// Environment = new EnvironmentProvider(),
// Framework = FrameworkConstants.CommonFrameworks.DnxCore50,
// Configuration = "Debug"
// };
// var commandSpec = scriptCommandResolver.Resolve(commandResolverArgs);
// commandSpec.Should().BeNull();
// }
// [Fact]
// public void It_resolves_ProjectLocal_commands_correctly()
// {
// var path = Path.Combine(AppContext.BaseDirectory,
// "testdir");
// var testCommandPath = CreateTestCommandFile(path, ".exe", "scriptprojectlocalcommand");
// var testCommandName = Path.GetFileNameWithoutExtension(testCommandPath);
// var scriptCommandResolver = new ScriptCommandResolver();
// var commandResolverArgs = new CommandResolverArguments
// {
// CommandName = testCommandName,
// CommandArguments = new string[] {},
// ProjectDirectory = path,
// Environment = new EnvironmentProvider()
// };
// var commandSpec = scriptCommandResolver.Resolve(commandResolverArgs);
// commandSpec.Should().NotBeNull();
// commandSpec.Path.Should().Be(testCommandPath);
// commandSpec.ResolutionStrategy.Should().Be(CommandResolutionStrategy.ProjectLocal);
// }
// public string CreateTestCommandFile(string path, string extension, string name = "testcommand")
// {
// Directory.CreateDirectory(path);
// var filename = name + extension;
// var filepath = Path.Combine(path, filename);
// File.WriteAllText(filepath, "hello world");
// return filepath;
// }
}
}