2017-05-17 23:05:22 +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 FluentAssertions;
|
|
|
|
|
using Microsoft.DotNet.TestFramework;
|
|
|
|
|
using Microsoft.DotNet.Tools.Test.Utilities;
|
|
|
|
|
using Xunit;
|
|
|
|
|
|
|
|
|
|
namespace Microsoft.DotNet.Tests
|
|
|
|
|
{
|
|
|
|
|
public class GivenThatICareAboutVBApps : TestBase
|
|
|
|
|
{
|
|
|
|
|
private TestAssetInstance _testInstance;
|
|
|
|
|
|
|
|
|
|
public GivenThatICareAboutVBApps()
|
|
|
|
|
{
|
|
|
|
|
_testInstance = TestAssets.Get("VBTestApp")
|
|
|
|
|
.CreateInstance()
|
|
|
|
|
.WithSourceFiles();
|
|
|
|
|
|
|
|
|
|
new RestoreCommand()
|
|
|
|
|
.WithWorkingDirectory(_testInstance.Root)
|
|
|
|
|
.Execute()
|
|
|
|
|
.Should().Pass();
|
|
|
|
|
}
|
|
|
|
|
|
2017-05-18 17:09:36 +00:00
|
|
|
|
// Enable cross-plat once https://github.com/Microsoft/msbuild/issues/422 is fixed
|
|
|
|
|
[WindowsOnlyFact]
|
2017-05-17 23:05:22 +00:00
|
|
|
|
public void ICanBuildVBApps()
|
|
|
|
|
{
|
|
|
|
|
new BuildCommand()
|
|
|
|
|
.WithWorkingDirectory(_testInstance.Root)
|
|
|
|
|
.Execute()
|
|
|
|
|
.Should().Pass();
|
|
|
|
|
}
|
|
|
|
|
|
2017-05-18 17:09:36 +00:00
|
|
|
|
// Enable cross-plat once https://github.com/Microsoft/msbuild/issues/422 is fixed
|
|
|
|
|
[WindowsOnlyFact]
|
2017-05-17 23:05:22 +00:00
|
|
|
|
public void ICanRunVBApps()
|
|
|
|
|
{
|
|
|
|
|
new RunCommand()
|
|
|
|
|
.WithWorkingDirectory(_testInstance.Root)
|
|
|
|
|
.Execute()
|
|
|
|
|
.Should().Pass();
|
|
|
|
|
}
|
|
|
|
|
|
2017-05-18 17:09:36 +00:00
|
|
|
|
// Enable cross-plat once https://github.com/Microsoft/msbuild/issues/422 is fixed
|
|
|
|
|
[WindowsOnlyFact]
|
2017-05-17 23:05:22 +00:00
|
|
|
|
public void ICanPublicAndRunVBApps()
|
|
|
|
|
{
|
|
|
|
|
new PublishCommand()
|
|
|
|
|
.WithWorkingDirectory(_testInstance.Root)
|
|
|
|
|
.Execute()
|
|
|
|
|
.Should().Pass();
|
|
|
|
|
|
|
|
|
|
var configuration = Environment.GetEnvironmentVariable("CONFIGURATION") ?? "Debug";
|
|
|
|
|
var outputDll = Path.Combine(
|
|
|
|
|
_testInstance.Root.FullName,
|
|
|
|
|
"bin",
|
|
|
|
|
configuration,
|
|
|
|
|
"netcoreapp2.0",
|
|
|
|
|
"publish",
|
|
|
|
|
"VBTestApp.dll");
|
|
|
|
|
|
|
|
|
|
new DotnetCommand()
|
|
|
|
|
.ExecuteWithCapturedOutput(outputDll)
|
|
|
|
|
.Should().Pass()
|
|
|
|
|
.And.HaveStdOutContaining("Hello World");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|