2016-02-16 09:31:44 +00:00
|
|
|
using System;
|
|
|
|
using System.IO;
|
|
|
|
using Microsoft.DotNet.Tools.Test.Utilities;
|
|
|
|
using Xunit;
|
|
|
|
|
|
|
|
namespace Microsoft.DotNet.ProjectModel.Tests
|
|
|
|
{
|
|
|
|
public class LibraryExporterTests : TestBase
|
|
|
|
{
|
|
|
|
[Fact]
|
|
|
|
public void GetLibraryExportsWithoutLockFile()
|
|
|
|
{
|
|
|
|
|
2016-08-10 06:59:14 +00:00
|
|
|
var testInstance = TestAssetsManager.CreateTestInstance("TestAppWithLibrary");
|
|
|
|
|
|
|
|
foreach (var lockfile in Directory.GetFiles(testInstance.Path, "project.lock.json"))
|
2016-02-16 09:31:44 +00:00
|
|
|
{
|
|
|
|
File.Delete(lockfile);
|
|
|
|
}
|
|
|
|
|
2016-08-10 06:59:14 +00:00
|
|
|
var builder = new ProjectContextBuilder().WithProjectDirectory(Path.Combine(testInstance.Path, "TestApp"));
|
2016-02-16 09:31:44 +00:00
|
|
|
|
|
|
|
foreach (var context in builder.BuildAllTargets())
|
|
|
|
{
|
|
|
|
var exporter = context.CreateExporter("Debug");
|
|
|
|
var exports = exporter.GetAllExports();
|
|
|
|
Assert.NotEmpty(exports);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|