2016-07-21 20:04:05 +00:00
|
|
|
|
// Copyright (c) .NET Foundation and contributors. All rights reserved.
|
|
|
|
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
|
|
|
|
2016-08-10 14:21:43 +00:00
|
|
|
|
using System.Runtime.InteropServices;
|
2016-07-21 20:04:05 +00:00
|
|
|
|
using Microsoft.DotNet.Tools.Test.Utilities;
|
|
|
|
|
using Xunit;
|
|
|
|
|
|
|
|
|
|
namespace Microsoft.DotNet.Tests.EndToEnd
|
|
|
|
|
{
|
|
|
|
|
public class GivenDotNetUsesMSBuild : TestBase
|
|
|
|
|
{
|
2016-08-10 14:21:43 +00:00
|
|
|
|
[Fact]
|
2016-07-21 20:04:05 +00:00
|
|
|
|
public void ItCanNewRestoreBuildRunMSBuildProject()
|
|
|
|
|
{
|
2016-08-10 14:21:43 +00:00
|
|
|
|
// The current ResolveNuGetAssets target does not work on case-sensitive file systems. We need https://github.com/dotnet/sdk/pull/10
|
|
|
|
|
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ||
|
|
|
|
|
RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
|
2016-07-21 20:04:05 +00:00
|
|
|
|
{
|
2016-08-10 14:21:43 +00:00
|
|
|
|
using (DisposableDirectory directory = Temp.CreateDirectory())
|
|
|
|
|
{
|
|
|
|
|
string projectDirectory = directory.Path;
|
2016-07-21 20:04:05 +00:00
|
|
|
|
|
2016-08-10 14:21:43 +00:00
|
|
|
|
new NewCommand()
|
|
|
|
|
.WithWorkingDirectory(projectDirectory)
|
|
|
|
|
.Execute("-t msbuild")
|
|
|
|
|
.Should()
|
|
|
|
|
.Pass();
|
2016-07-21 20:04:05 +00:00
|
|
|
|
|
2016-08-10 14:21:43 +00:00
|
|
|
|
new RestoreCommand()
|
|
|
|
|
.WithWorkingDirectory(projectDirectory)
|
|
|
|
|
.Execute()
|
|
|
|
|
.Should()
|
|
|
|
|
.Pass();
|
2016-07-21 20:04:05 +00:00
|
|
|
|
|
2016-08-10 14:21:43 +00:00
|
|
|
|
new Build3Command()
|
|
|
|
|
.WithWorkingDirectory(projectDirectory)
|
|
|
|
|
.Execute()
|
|
|
|
|
.Should()
|
|
|
|
|
.Pass();
|
2016-07-21 20:04:05 +00:00
|
|
|
|
|
2016-08-10 14:21:43 +00:00
|
|
|
|
new Run3Command()
|
|
|
|
|
.WithWorkingDirectory(projectDirectory)
|
|
|
|
|
.ExecuteWithCapturedOutput()
|
|
|
|
|
.Should()
|
|
|
|
|
.Pass()
|
|
|
|
|
.And
|
|
|
|
|
.HaveStdOutContaining("Hello World!");
|
|
|
|
|
}
|
2016-07-21 20:04:05 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|