private static void SetupStaticTestProject() { AssetsRoot = Path.Combine(AppContext.BaseDirectory, "bin"); RestoredTestProjectDirectory = Path.Combine(AssetsRoot, s_testdirName); // Ignore Delete Failure try { Directory.Delete(RestoredTestProjectDirectory, true); } catch (Exception) { } Directory.CreateDirectory(RestoredTestProjectDirectory); // Todo: this is a hack until corefx is on nuget.org remove this After RC 2 Release NuGetConfig.Write(RestoredTestProjectDirectory); var newCommand = new NewCommand(); newCommand.WorkingDirectory = RestoredTestProjectDirectory; newCommand.Execute().Should().Pass(); var restoreCommand = new Restore3Command(); restoreCommand.WorkingDirectory = RestoredTestProjectDirectory; restoreCommand.Execute("/p:SkipInvalidConfigurations=true") .Should().Pass(); }
private void Restore3(string projectDirectory, string projectName = null) { var command = new Restore3Command() .WithWorkingDirectory(projectDirectory); if (projectName != null) { command.Execute($"{projectName}.csproj /p:SkipInvalidConfigurations=true") .Should().Pass(); } else { command.Execute("/p:SkipInvalidConfigurations=true") .Should().Pass(); } }
private void Restore3(string projectDirectory, string projectName = null) { var command = new Restore3Command() .WithWorkingDirectory(projectDirectory); if (projectName != null) { command.Execute($"{projectName}.csproj") .Should() .Pass(); } else { command.Execute() .Should() .Pass(); } }