File tree 3 files changed +49
-3
lines changed
Buildalyzer.Tests/Integration
projects/ProjectFileAsAdditionalFile
3 files changed +49
-3
lines changed Original file line number Diff line number Diff line change @@ -709,9 +709,28 @@ public void GetsAdditionalFile()
709
709
// When
710
710
IEnumerable < string > additionalFiles = analyzer . Build ( ) . First ( ) . AdditionalFiles ;
711
711
712
- // Then
713
- additionalFiles . ShouldBe ( new [ ] { "message.txt" } , log . ToString ( ) ) ;
714
- }
712
+ [ Test ]
713
+ public void GetsProjectFileAsAdditionalFile ( )
714
+ {
715
+ // Given
716
+ StringWriter log = new StringWriter ( ) ;
717
+ IProjectAnalyzer analyzer = GetProjectAnalyzer ( @"ProjectFileAsAdditionalFile\ProjectFileAsAdditionalFile.csproj" , log ) ;
718
+
719
+ // When
720
+ IEnumerable < string > additionalFiles = analyzer . Build ( ) . First ( ) . AdditionalFiles ;
721
+
722
+ // Then
723
+ additionalFiles . ShouldBe ( new [ ] { "ProjectFileAsAdditionalFile.csproj" } , log . ToString ( ) ) ;
724
+ }
725
+
726
+ private static IProjectAnalyzer GetProjectAnalyzer ( string projectFile , StringWriter log )
727
+ {
728
+ IProjectAnalyzer analyzer = new AnalyzerManager (
729
+ new AnalyzerManagerOptions
730
+ {
731
+ LogWriter = log
732
+ } )
733
+ . GetProject ( GetProjectPath ( projectFile ) ) ;
715
734
716
735
private static IProjectAnalyzer GetProjectAnalyzer ( string projectFile , StringWriter log )
717
736
{
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