Skip to content

Commit

Permalink
Test fixup after different target framework sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
daveaglick committed Dec 20, 2023
1 parent 8e85a15 commit 19eedd5
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions tests/Buildalyzer.Tests/Integration/SimpleProjectsFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,16 +155,14 @@ public void GetsReferences(
};

// When
IReadOnlyList<string> references = analyzer.Build(options).First().References;
IAnalyzerResults results = analyzer.Build(options);

// Then
references.ShouldNotBeNull(log.ToString());
references.ShouldContain(
x => x.Contains("mscorlib"),
log.ToString() + System.Environment.NewLine + "References:" + string.Join(System.Environment.NewLine, references));
results.ShouldAllBe(x => x.References != null, log.ToString());
results.Any(x => x.References.Any(r => r.Contains("mscorlib"))).ShouldBeTrue(log.ToString());
if (projectFile.Contains("PackageReference"))
{
references.ShouldContain(x => x.EndsWith("NodaTime.dll"), log.ToString());
results.Any(x => x.References.Any(r => r.EndsWith("NodaTime.dll"))).ShouldBeTrue(log.ToString());
}
}

Expand Down Expand Up @@ -246,7 +244,7 @@ public void MultiTargetingBuildAllTargetFrameworksGetsSourceFiles()
// Then
// Multi-targeting projects product an extra result with an empty target framework that holds some MSBuild properties (I.e. the "outer" build)
results.Count.ShouldBe(3);
results.TargetFrameworks.ShouldBe(new[] { "net462", "netstandard2.0", string.Empty }, ignoreOrder: false, log.ToString());
results.TargetFrameworks.ShouldBe(new[] { string.Empty, "net462", "netstandard2.0" }, ignoreOrder: false, log.ToString());
results[string.Empty].SourceFiles.ShouldBeEmpty();
new[]
{
Expand Down

0 comments on commit 19eedd5

Please sign in to comment.