-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Copy pathGivenThatWeWantToBuildADesktopExeWithFSharp.cs
60 lines (52 loc) · 1.88 KB
/
GivenThatWeWantToBuildADesktopExeWithFSharp.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
#nullable disable
namespace Microsoft.NET.Build.Tests
{
public class GivenThatWeWantToBuildADesktopExeWithFSharp : SdkTest
{
public GivenThatWeWantToBuildADesktopExeWithFSharp(ITestOutputHelper log) : base(log)
{
}
[WindowsOnlyFact]
public void It_builds_a_simple_desktop_app()
{
var targetFramework = "net462";
var testAsset = _testAssetsManager
.CopyTestAsset("HelloWorldFS")
.WithSource()
.WithProjectChanges(project =>
{
var ns = project.Root.Name.Namespace;
var propertyGroup = project.Root.Elements(ns + "PropertyGroup").First();
propertyGroup.Element(ns + "TargetFramework").SetValue(targetFramework);
});
var buildCommand = new BuildCommand(testAsset);
buildCommand
.Execute()
.Should()
.Pass();
var outputDirectory = buildCommand.GetOutputDirectory(targetFramework);
outputDirectory.Should().OnlyHaveFiles(new[] {
"TestApp.exe",
"TestApp.exe.config",
"TestApp.pdb",
"FSharp.Core.dll",
"System.ValueTuple.dll",
});
}
[WindowsOnlyFact]
public void It_builds_a_simple_net50_app()
{
var testAsset = _testAssetsManager
.CopyTestAsset("HelloWorldFS")
.WithSource()
.WithTargetFramework("net5.0");
var buildCommand = new BuildCommand(testAsset);
buildCommand
.Execute()
.Should()
.Pass();
}
}
}