2016-04-19 00:46:27 +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.
|
|
|
|
|
|
|
|
using System;
|
|
|
|
using System.IO;
|
|
|
|
using Microsoft.DotNet.Tools.Test.Utilities;
|
|
|
|
using FluentAssertions;
|
|
|
|
|
|
|
|
namespace Microsoft.DotNet.Cli.Utils.Tests
|
|
|
|
{
|
|
|
|
public class GivenADesktopAppWhichUsesCommandCreateDotnet : TestBase
|
|
|
|
{
|
|
|
|
[WindowsOnlyFact]
|
|
|
|
public void It_calls_dotnet_build_on_a_project_successfully()
|
|
|
|
{
|
|
|
|
var testAssetsManager = GetTestGroupTestAssetsManager("DesktopTestProjects");
|
|
|
|
var testInstance = testAssetsManager
|
|
|
|
.CreateTestInstance("DesktopAppWhichCallsDotnet")
|
|
|
|
.WithLockFiles()
|
|
|
|
.WithBuildArtifacts();
|
2016-04-20 02:14:59 +00:00
|
|
|
// project was moved to another location and needs it's relative path to Utils project restored
|
|
|
|
new RestoreCommand().Execute(testInstance.TestRoot).Should().Pass();
|
2016-04-19 00:46:27 +00:00
|
|
|
|
|
|
|
var testProjectAssetManager = GetTestGroupTestAssetsManager("TestProjects");
|
|
|
|
var testInstanceToBuild = testProjectAssetManager
|
|
|
|
.CreateTestInstance("TestAppSimple")
|
|
|
|
.WithLockFiles();
|
2016-04-20 02:14:59 +00:00
|
|
|
|
2016-04-19 00:46:27 +00:00
|
|
|
var testProject = Path.Combine(testInstance.TestRoot, "project.json");
|
|
|
|
var testProjectToBuild = Path.Combine(testInstanceToBuild.TestRoot, "project.json");
|
|
|
|
|
|
|
|
new RunCommand(testProject).Execute(testProjectToBuild).Should().Pass();
|
|
|
|
}
|
|
|
|
}
|
2016-04-19 21:38:24 +00:00
|
|
|
}
|