Skip to content

Commit edc3a3e

Browse files
committed
Replay.
1 parent 59360a7 commit edc3a3e

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
-0
lines changed

tests/Buildalyzer.Tests/Integration/SimpleProjectsFixture.cs

+14
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,20 @@ public void GetsAdditionalFile()
716716
additionalFiles.ShouldBe(new[] { "message.txt" }, log.ToString());
717717
}
718718

719+
[Test]
720+
public void GetsProjectFileAsAdditionalFile()
721+
{
722+
// Given
723+
StringWriter log = new StringWriter();
724+
IProjectAnalyzer analyzer = GetProjectAnalyzer(@"ProjectFileAsAdditionalFile\ProjectFileAsAdditionalFile.csproj", log);
725+
726+
// When
727+
IEnumerable<string> additionalFiles = analyzer.Build().First().AdditionalFiles;
728+
729+
// Then
730+
additionalFiles.ShouldBe(new[] { "ProjectFileAsAdditionalFile.csproj" }, log.ToString());
731+
}
732+
719733
private static IProjectAnalyzer GetProjectAnalyzer(string projectFile, StringWriter log)
720734
{
721735
IProjectAnalyzer analyzer = new AnalyzerManager(
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net6.0</TargetFramework>
5+
<ImplicitUsings>enable</ImplicitUsings>
6+
<ImplicitUsings>disable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
<ProductName>Test project</ProductName>
9+
</PropertyGroup>
10+
11+
<PropertyGroup>
12+
<TargetFrameworks>net5.0;net6.0</TargetFrameworks>
13+
<Nullable>annotations</Nullable>
14+
</PropertyGroup>
15+
16+
<PropertyGroup Condition="'1' == '1'">
17+
<ProductName>Test project</ProductName>
18+
</PropertyGroup>
19+
20+
<ItemGroup>
21+
<AdditionalFiles Include="*.??proj" Visible="false" />
22+
</ItemGroup>
23+
24+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
namespace ProjectWithAdditionalFile;
2+
3+
public class SomeClass { }

0 commit comments

Comments
 (0)