Add support for reading DepedencyContext from deps file

This commit is contained in:
Pavel Krymets 2016-02-19 16:48:43 -08:00
parent 7407a898e0
commit 62284943fc
18 changed files with 438 additions and 20 deletions

View file

@ -4,6 +4,7 @@
using System;
using System.IO;
using Microsoft.DotNet.Cli.Utils;
using Microsoft.DotNet.TestFramework;
using Microsoft.DotNet.Tools.Test.Utilities;
using FluentAssertions;
using Xunit;
@ -146,6 +147,26 @@ namespace Microsoft.DotNet.Tools.Compiler.Tests
result.StdOut.Should().Contain("MyNamespace.Util");
}
[Fact]
public void EmbeddedDependencyContextIsValidOnBuild()
{
var testProjectPath = Path.Combine(RepoRoot, "TestAssets", "TestProjects", "DependencyContextValidator", "TestApp");
var testProject = Path.Combine(testProjectPath, "project.json");
var runCommand = new RunCommand(testProject);
runCommand.Execute().Should().Pass();
}
[Fact]
public void DepsDependencyContextIsValidOnBuild()
{
var testProjectPath = Path.Combine(RepoRoot, "TestAssets", "TestProjects", "DependencyContextValidator", "TestAppDeps");
var testProject = Path.Combine(testProjectPath, "project.json");
var runCommand = new RunCommand(testProject);
runCommand.Execute().Should().Pass();
}
private void CopyProjectToTempDir(string projectDir, TempDirectory tempDir)
{
// copy all the files to temp dir