File tree 3 files changed +41
-0
lines changed
Buildalyzer.Tests/Integration
projects/ProjectFileAsAdditionalFile
3 files changed +41
-0
lines changed Original file line number Diff line number Diff line change @@ -716,6 +716,20 @@ public void GetsAdditionalFile()
716
716
additionalFiles . ShouldBe ( new [ ] { "message.txt" } , log . ToString ( ) ) ;
717
717
}
718
718
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
+
719
733
private static IProjectAnalyzer GetProjectAnalyzer ( string projectFile , StringWriter log )
720
734
{
721
735
IProjectAnalyzer analyzer = new AnalyzerManager (
Original file line number Diff line number Diff line change
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 number Diff line number Diff line change
1
+ namespace ProjectWithAdditionalFile ;
2
+
3
+ public class SomeClass { }
You can’t perform that action at this time.
0 commit comments