Skip to content

Commit

Permalink
Collection literals (#2001)
Browse files Browse the repository at this point in the history
Use collection literals for assertion expected values.
  • Loading branch information
martincostello authored Oct 19, 2023
1 parent e372a22 commit 91dd4c2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/LondonTravel.Site.Tests/Integration/AlexaTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ await WithNavigatorAsync(

// Assert
secondResult.RootElement.GetString("userId").ShouldNotBeNullOrWhiteSpace();
secondResult.RootElement.GetStringArray("favoriteLines").ShouldBe(new[] { "district" });
secondResult.RootElement.GetStringArray("favoriteLines").ShouldBe(["district"]);

// Arrange
page = await homepage.ManageAsync();
Expand Down
4 changes: 2 additions & 2 deletions tests/LondonTravel.Site.Tests/Integration/ApiTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public async Task Cannot_Get_Preferences_With_Invalid_Token(string value)
result.RootElement.GetString("message").ShouldBe("Unauthorized.");
result.RootElement.GetInt32("statusCode").ShouldBe(401);
result.RootElement.GetStringArray("details").ShouldNotBeNull();
result.RootElement.GetStringArray("details").ShouldBe(new[] { "The provided authorization value is not valid." });
result.RootElement.GetStringArray("details").ShouldBe(["The provided authorization value is not valid."]);
}

[Theory]
Expand All @@ -94,7 +94,7 @@ public async Task Cannot_Get_Preferences_With_Invalid_Scheme_Value(string value)
result.RootElement.GetString("message").ShouldBe("Unauthorized.");
result.RootElement.GetInt32("statusCode").ShouldBe(401);
result.RootElement.GetStringArray("details").ShouldNotBeNull();
result.RootElement.GetStringArray("details").ShouldBe(new[] { "Only the bearer authorization scheme is supported." });
result.RootElement.GetStringArray("details").ShouldBe(["Only the bearer authorization scheme is supported."]);
}

[Theory]
Expand Down

0 comments on commit 91dd4c2

Please sign in to comment.