Skip to content

Commit

Permalink
Update test.
Browse files Browse the repository at this point in the history
  • Loading branch information
Corniel committed Jul 31, 2024
1 parent 1162666 commit 37f4356
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tests/Buildalyzer.Tests/Integration/SimpleProjectsFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -716,12 +716,15 @@ public void GetsProjectFileAsAdditionalFile()
using var log = new StringWriter();
IProjectAnalyzer analyzer = GetProjectAnalyzer(@"ProjectFileAsAdditionalFile\ProjectFileAsAdditionalFile.csproj", log);

// When
var builds = analyzer.Build();

// When + then
builds.First().AdditionalFiles
.Select(Path.GetFileName)
.Should().BeEquivalentTo("ProjectFileAsAdditionalFile.csproj");
// Then
var v6_0 = builds.Single(b => b.TargetFramework == "net6.0");
var v5_0 = builds.Single(b => b.TargetFramework == "net5.0");

v6_0.AdditionalFiles.Select(Path.GetFileName).Should().BeEquivalentTo("ProjectFileAsAdditionalFile.csproj");
v5_0.AdditionalFiles.Select(Path.GetFileName).Should().BeEquivalentTo("ProjectFileAsAdditionalFile.csproj");

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

View workflow job for this annotation

GitHub Actions / Test Results (ubuntu-latest)

Buildalyzer.Tests.Integration.SimpleProjectsFixture ► GetsProjectFileAsAdditionalFile

Failed test found in: tests/Buildalyzer.Tests/TestResults/test-results.trx Error: Expected v5_0.AdditionalFiles.Select(Path.GetFileName) to be a collection with 1 item(s), but found an empty collection. With configuration: - Use declared types and members - Compare enums by value - Compare tuples by their properties - Compare anonymous types by their properties - Compare records by their members - Include non-browsable members - Include all non-private properties - Include all non-private fields - Match member by name (or throw) - Be strict about the order of items in byte arrays - Without automatic conversion.
Raw output
Expected v5_0.AdditionalFiles.Select(Path.GetFileName) to be a collection with 1 item(s), but found an empty collection.

With configuration:
- Use declared types and members
- Compare enums by value
- Compare tuples by their properties
- Compare anonymous types by their properties
- Compare records by their members
- Include non-browsable members
- Include all non-private properties
- Include all non-private fields
- Match member by name (or throw)
- Be strict about the order of items in byte arrays
- Without automatic conversion.

   at FluentAssertions.Execution.LateBoundTestFramework.Throw(String message)
   at FluentAssertions.Execution.TestFrameworkProvider.Throw(String message)
   at FluentAssertions.Execution.CollectingAssertionStrategy.ThrowIfAny(IDictionary`2 context)
   at FluentAssertions.Execution.AssertionScope.Dispose()
   at FluentAssertions.Equivalency.EquivalencyValidator.AssertEquality(Comparands comparands, EquivalencyValidationContext context)
   at FluentAssertions.Collections.StringCollectionAssertions`2.BeEquivalentTo(IEnumerable`1 expectation, Func`2 config, String because, Object[] becauseArgs)
   at FluentAssertions.Collections.StringCollectionAssertions`2.BeEquivalentTo(String[] expectation)
   at Buildalyzer.Tests.Integration.SimpleProjectsFixture.GetsProjectFileAsAdditionalFile() in /home/runner/work/Buildalyzer/Buildalyzer/tests/Buildalyzer.Tests/Integration/SimpleProjectsFixture.cs:line 727

}

[Test]
Expand Down

0 comments on commit 37f4356

Please sign in to comment.