Skip to content

Commit

Permalink
Replay.
Browse files Browse the repository at this point in the history
  • Loading branch information
Corniel committed Jul 31, 2024
1 parent 7df378f commit ce105e1
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 4 deletions.
29 changes: 25 additions & 4 deletions tests/Buildalyzer.Tests/Integration/SimpleProjectsFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -704,10 +704,31 @@ public void GetsAdditionalFile()
StringWriter log = new StringWriter();
IProjectAnalyzer analyzer = GetProjectAnalyzer(@"ProjectWithAdditionalFile\ProjectWithAdditionalFile.csproj", log);

// When + then
analyzer.Build().First().AdditionalFiles.Select(Path.GetFileName)
.Should().BeEquivalentTo("message.txt");
}
// When
IEnumerable<string> additionalFiles = analyzer.Build().First().AdditionalFiles;

[Test]
public void GetsProjectFileAsAdditionalFile()

Check failure on line 711 in tests/Buildalyzer.Tests/Integration/SimpleProjectsFixture.cs

View workflow job for this annotation

GitHub Actions / Build (ubuntu-latest)

The modifier 'public' is not valid for this item

Check failure on line 711 in tests/Buildalyzer.Tests/Integration/SimpleProjectsFixture.cs

View workflow job for this annotation

GitHub Actions / Build (macos-12)

The modifier 'public' is not valid for this item
{
// Given
StringWriter log = new StringWriter();
IProjectAnalyzer analyzer = GetProjectAnalyzer(@"ProjectFileAsAdditionalFile\ProjectFileAsAdditionalFile.csproj", log);

// When
IEnumerable<string> additionalFiles = analyzer.Build().First().AdditionalFiles;

// Then
additionalFiles.ShouldBe(new[] { "ProjectFileAsAdditionalFile.csproj" }, log.ToString());
}

private static IProjectAnalyzer GetProjectAnalyzer(string projectFile, StringWriter log)

Check failure on line 724 in tests/Buildalyzer.Tests/Integration/SimpleProjectsFixture.cs

View workflow job for this annotation

GitHub Actions / Build (ubuntu-latest)

The modifier 'private' is not valid for this item

Check failure on line 724 in tests/Buildalyzer.Tests/Integration/SimpleProjectsFixture.cs

View workflow job for this annotation

GitHub Actions / Build (macos-12)

The modifier 'private' is not valid for this item
{
IProjectAnalyzer analyzer = new AnalyzerManager(
new AnalyzerManagerOptions
{
LogWriter = log
})
.GetProject(GetProjectPath(projectFile));

[Test]
public void HandlesProcessFailure()

Check failure on line 734 in tests/Buildalyzer.Tests/Integration/SimpleProjectsFixture.cs

View workflow job for this annotation

GitHub Actions / Build (ubuntu-latest)

The modifier 'public' is not valid for this item

Check failure on line 734 in tests/Buildalyzer.Tests/Integration/SimpleProjectsFixture.cs

View workflow job for this annotation

GitHub Actions / Build (macos-12)

The modifier 'public' is not valid for this item
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>
<ProductName>Test project</ProductName>
</PropertyGroup>

<PropertyGroup>
<TargetFrameworks>net5.0;net6.0</TargetFrameworks>
<Nullable>annotations</Nullable>
</PropertyGroup>

<PropertyGroup Condition="'1' == '1'">
<ProductName>Test project</ProductName>
</PropertyGroup>

<ItemGroup>
<AdditionalFiles Include="*.??proj" Visible="false" />
</ItemGroup>

</Project>
3 changes: 3 additions & 0 deletions tests/projects/ProjectFileAsAdditionalFile/SomeClass.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
namespace ProjectWithAdditionalFile;

public class SomeClass { }

0 comments on commit ce105e1

Please sign in to comment.