Skip to content

Commit

Permalink
Fix tests, uses dictionaries lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
KonH committed Oct 27, 2023
1 parent 1eb95bf commit 74431ce
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,9 @@ public async Task BlockFileParserV1WithSingleBlock_ParsesAsync()
block.Title.Should().Be("block1");
block.Children.Should().ContainSingle();
block.Values["property"].Should().Be("value");
block.Children.Single(x => x.Title == "block2").Values.Should().ContainValue("otherProperty")
.Which.Should().Be("otherValue");
block.Children.Single(x => x.Title == "block2").Values.Should().ContainKey("otherProperty");
var value = block.Children.Single(x => x.Title == "block2").Values["otherProperty"];
value.Should().Be("otherValue");
file.VersionHeader.Should().Be(yarnLockFileVersionString);
file.YarnLockVersion.Should().Be(YarnLockVersion.V1);
}
Expand Down Expand Up @@ -204,8 +205,8 @@ public async Task BlockFileParserV2WithSingleBlock_ParsesAsync()
block.Title.Should().Be("block1");
block.Children.Should().ContainSingle();
block.Values["property"].Should().Be("value");
block.Children.Single(x => x.Title == "block2").Values.Should().ContainValue("otherProperty")
.Which.Should().Be("otherValue");
block.Children.Single(x => x.Title == "block2").Values.Should().ContainKey("otherProperty");
var value = block.Children.Single(x => x.Title == "block2").Values["otherProperty"];
file.VersionHeader.Should().Be(yarnLockFileVersionString);
file.YarnLockVersion.Should().Be(YarnLockVersion.V2);
}
Expand Down Expand Up @@ -243,8 +244,8 @@ public async Task BlockFileParserV2WithSingleBlock_ParsesWithQuotesAsync()
block.Title.Should().Be("block1");
block.Children.Should().ContainSingle();
block.Values["property"].Should().Be("value");
block.Children.Single(x => x.Title == "block2").Values.Should().ContainValue("otherProperty")
.Which.Should().Be("otherValue");
block.Children.Single(x => x.Title == "block2").Values.Should().ContainKey("otherProperty");
var value = block.Children.Single(x => x.Title == "block2").Values["otherProperty"];
file.VersionHeader.Should().Be(yarnLockFileVersionString);
file.YarnLockVersion.Should().Be(YarnLockVersion.V2);
}
Expand Down

0 comments on commit 74431ce

Please sign in to comment.