Skip to content

Commit

Permalink
Compilation of exe should fail.
Browse files Browse the repository at this point in the history
  • Loading branch information
Corniel committed Nov 13, 2024
1 parent 28cf9aa commit a62de2c
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/Buildalyzer.Tests/Integration/SimpleProjectsFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,17 @@ public void Builds_DesignTime(
results.Should().AllSatisfy(r => r.Succeeded.Should().BeTrue());
}

[Test]
public void Respects_output_type()
{
using var ctx = Context.ForProject("OutputTypeExe/OutputTypeExe.csproj");

var results = ctx.Analyzer.Build();

results.Should().NotBeEmpty();
results.OverallSuccess.Should().BeFalse();
}

[Test]
public void BuildsProject(
[ValueSource(nameof(Preferences))] EnvironmentPreference preference,
Expand Down
8 changes: 8 additions & 0 deletions tests/projects/OutputTypeExe/OutputTypeExe.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<OutputType>exe</OutputType>
</PropertyGroup>

</Project>
6 changes: 6 additions & 0 deletions tests/projects/OutputTypeExe/Root.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace LowerCaseOutputType;

public class Root
{
public string Value { get; init; }
}

0 comments on commit a62de2c

Please sign in to comment.