remove nuget dependency in tests

This commit is contained in:
Bryan Thornbury 2016-09-21 21:23:50 -07:00
parent 8a420de736
commit a688885f21
5 changed files with 9 additions and 12 deletions

View file

@ -92,12 +92,6 @@ namespace Microsoft.DotNet.ProjectJsonMigration
var defaultProjectContext = projectContexts.First();
if (defaultProjectContext.LockFile == null)
{
MigrationErrorCodes.MIGRATE1012(
$"project.lock.json not found in {projectDirectory}, please run dotnet restore before doing migration").Throw();
}
var diagnostics = defaultProjectContext.ProjectFile.Diagnostics;
if (diagnostics.Any())
{

View file

@ -19,7 +19,7 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Tests
public void It_copies_ProjectDirectory_contents_to_OutputDirectory_when_the_directories_are_different()
{
var testProjectDirectory = TestAssetsManager.CreateTestInstance("TestAppSimple", callingMethod: "z")
.WithLockFiles().Path;
.Path;
var outputDirectory = Temp.CreateDirectory().Path;
var projectDirectoryRelativeFilePaths = EnumerateFilesWithRelativePath(testProjectDirectory);
@ -41,7 +41,7 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Tests
{
var testProjectDirectory =
TestAssetsManager.CreateTestInstance("TestLibraryWithDeprecatedProjectFile", callingMethod: "z")
.WithLockFiles().Path;
.Path;
var mockProj = ProjectRootElement.Create();
var testSettings = new MigrationSettings(testProjectDirectory, testProjectDirectory, "1.0.0", mockProj);
@ -60,7 +60,7 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Tests
{
var testProjectDirectory =
TestAssetsManager.CreateTestInstance("FSharpTestProjects/TestApp", callingMethod: "z")
.WithLockFiles().Path;
.Path;
var mockProj = ProjectRootElement.Create();
var testSettings = new MigrationSettings(testProjectDirectory, testProjectDirectory, "1.0.0", mockProj);

View file

@ -22,7 +22,7 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Tests
public void If_a_project_dependency_is_present_DesignTimeAutoUnify_and_AutoUnify_are_present()
{
var solutionDirectory =
TestAssetsManager.CreateTestInstance("TestAppWithLibrary", callingMethod: "p").WithLockFiles().Path;
TestAssetsManager.CreateTestInstance("TestAppWithLibrary", callingMethod: "p").Path;
var appDirectory = Path.Combine(solutionDirectory, "TestApp");
var libDirectory = Path.Combine(solutionDirectory, "TestLibrary");

View file

@ -25,7 +25,7 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Tests
[Fact]
public void RuntimeOptions_are_copied_from_projectJson_to_runtimeconfig_template_json_file()
{
var testInstance = TestAssetsManager.CreateTestInstance("TestAppWithRuntimeOptions").WithLockFiles();
var testInstance = TestAssetsManager.CreateTestInstance("TestAppWithRuntimeOptions");
var projectDir = testInstance.Path;
var projectPath = Path.Combine(testInstance.Path, "project.json");
@ -49,7 +49,7 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Tests
[Fact]
public void Migrating_ProjectJson_with_no_RuntimeOptions_produces_no_runtimeconfig_template_json_file()
{
var testInstance = TestAssetsManager.CreateTestInstance("TestAppSimple").WithLockFiles();
var testInstance = TestAssetsManager.CreateTestInstance("TestAppSimple");
var projectDir = testInstance.Path;
var projectContext = ProjectContext.Create(projectDir, FrameworkConstants.CommonFrameworks.NetCoreApp10);

View file

@ -142,6 +142,9 @@ namespace Microsoft.DotNet.Migration.Tests
var projectJsonBuildOutputs = new HashSet<string>(CollectBuildOutputs(projectDirectory));
CleanBinObj(projectDirectory);
// Remove lock file for migration
File.Delete(Path.Combine(projectDirectory, "project.lock.json"));
MigrateProject(projectDirectory);
Restore(projectDirectory);
BuildMSBuild(projectDirectory);