Skip to content
Permalink
Browse files

[Assets] Fixed TestBasicPackageCreateSaveLoad

  • Loading branch information
xen2 committed Dec 5, 2018
1 parent df6aae5 commit aa227b3f413ee0f121cfe11fdc6bc3487d5e7323
@@ -21,8 +21,6 @@ public void TestBasicPackageCreateSaveLoad()
var dirPath = DirectoryTestBase + @"TestBasicPackageCreateSaveLoad";

string testGenerated1 = Path.Combine(dirPath, "TestPackage_TestBasicPackageCreateSaveLoad_Generated1.xkpkg");
string testGenerated2 = Path.Combine(dirPath,"TestPackage_TestBasicPackageCreateSaveLoad_Generated2.xkpkg");
string referenceFilePath = Path.Combine(dirPath,"TestPackage_TestBasicPackageCreateSaveLoad_Reference.xkpkg");

// Force the PackageId to be the same each time we run the test
// Usually the PackageId is unique and generated each time we create a new project
@@ -56,17 +54,8 @@ public void TestBasicPackageCreateSaveLoad()
var project2 = project2Result.Session.LocalPackages.FirstOrDefault();
Assert.NotNull(project2);
Assert.True(project2.AssetFolders.Count > 0);
Assert.Equal(project2.Container, project2Result.Session.CurrentProject); // Check that the current package is setup when loading a single package
var sourceFolder = project.AssetFolders.First().Path;
Assert.Equal(sourceFolder, project2.AssetFolders.First().Path);

// Reload the package from the sln
var sessionResult = PackageSession.Load(session.SolutionPath);
Assert.False(sessionResult.HasErrors);

var sessionReload = sessionResult.Session;
Assert.Single(sessionReload.LocalPackages);
var reloadPackage = sessionReload.LocalPackages.First();
}

[Fact]
@@ -796,15 +796,16 @@ public static void Load(string filePath, PackageSessionResult sessionResult, Pac

session.LoadMissingDependencies(sessionResult, loadParameters);
}
else if (Path.GetExtension(filePath).ToLowerInvariant() == ".csproj")
else if (Path.GetExtension(filePath).ToLowerInvariant() == ".csproj"
|| Path.GetExtension(filePath).ToLowerInvariant() == Package.PackageFileExtension)
{
var project = (SolutionProject)session.LoadProject(sessionResult, filePath, false, loadParameters);
var project = session.LoadProject(sessionResult, filePath, false, loadParameters);
session.Projects.Add(project);
firstProject = project;
firstProject = project as SolutionProject;
}
else
{
sessionResult.Error($"Unsupported file extension (only .sln are supported)");
sessionResult.Error($"Unsupported file extension (only .sln, .csproj and .xkpkg are supported)");
return;
}

0 comments on commit aa227b3

Please sign in to comment.
You can’t perform that action at this time.