Add test for consuming .NET Standard 2.0 library from .NET Framework 4.6.1 project

This commit is contained in:
Daniel Plaisted 2017-06-08 15:40:22 -07:00
parent ac8a464450
commit c19ff8cc13
5 changed files with 98 additions and 0 deletions

View file

@ -0,0 +1,40 @@
using FluentAssertions;
using Microsoft.DotNet.TestFramework;
using Microsoft.DotNet.Tools.Test.Utilities;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
namespace EndToEnd
{
public class GivenNetFrameworkSupportsNetStandard2 : TestBase
{
[WindowsOnlyFact]
public void ANET461ProjectCanReferenceANETStandardProject()
{
var _testInstance = TestAssets.Get(TestAssetKinds.DesktopTestProjects, "NETFrameworkReferenceNETStandard20")
.CreateInstance()
.WithSourceFiles();
string projectDirectory = Path.Combine(_testInstance.Root.FullName, "TestApp");
new RestoreCommand()
.WithWorkingDirectory(projectDirectory)
.Execute()
.Should().Pass();
new BuildCommand()
.WithWorkingDirectory(projectDirectory)
.Execute()
.Should().Pass();
new RunCommand()
.WithWorkingDirectory(projectDirectory)
.ExecuteWithCapturedOutput()
.Should().Pass()
.And.HaveStdOutContaining("This string came from the test library!");
}
}
}