Skip to content

Commit 7a48460

Browse files
committed
Compilation of exe should fail.
1 parent 5c55d2c commit 7a48460

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

tests/Buildalyzer.Tests/Integration/SimpleProjectsFixture.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,17 @@ public void Builds_DesignTime(
8080
results.Should().AllSatisfy(r => r.Succeeded.Should().BeTrue());
8181
}
8282

83+
[Test]
84+
public void Respects_output_type()
85+
{
86+
using var ctx = Context.ForProject("OutputTypeExe/OutputTypeExe.csproj");
87+
88+
var results = ctx.Analyzer.Build();
89+
90+
results.Should().NotBeEmpty();
91+
results.OverallSuccess.Should().BeFalse();
92+
}
93+
8394
[Test]
8495
public void BuildsProject(
8596
[ValueSource(nameof(Preferences))] EnvironmentPreference preference,
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net8.0</TargetFramework>
5+
<OutputType>exe</OutputType>
6+
</PropertyGroup>
7+
8+
</Project>

tests/projects/OutputTypeExe/Root.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
namespace LowerCaseOutputType;
2+
3+
public class Root
4+
{
5+
public string Value { get; init; }
6+
}

0 commit comments

Comments
 (0)