Skip to content

Commit 19eedd5

Browse files
committed
Test fixup after different target framework sorting
1 parent 8e85a15 commit 19eedd5

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

tests/Buildalyzer.Tests/Integration/SimpleProjectsFixture.cs

+5-7
Original file line numberDiff line numberDiff line change
@@ -155,16 +155,14 @@ public void GetsReferences(
155155
};
156156

157157
// When
158-
IReadOnlyList<string> references = analyzer.Build(options).First().References;
158+
IAnalyzerResults results = analyzer.Build(options);
159159

160160
// Then
161-
references.ShouldNotBeNull(log.ToString());
162-
references.ShouldContain(
163-
x => x.Contains("mscorlib"),
164-
log.ToString() + System.Environment.NewLine + "References:" + string.Join(System.Environment.NewLine, references));
161+
results.ShouldAllBe(x => x.References != null, log.ToString());
162+
results.Any(x => x.References.Any(r => r.Contains("mscorlib"))).ShouldBeTrue(log.ToString());
165163
if (projectFile.Contains("PackageReference"))
166164
{
167-
references.ShouldContain(x => x.EndsWith("NodaTime.dll"), log.ToString());
165+
results.Any(x => x.References.Any(r => r.EndsWith("NodaTime.dll"))).ShouldBeTrue(log.ToString());
168166
}
169167
}
170168

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

0 commit comments

Comments
 (0)