Skip to content

Commit fc15ec7

Browse files
author
Sam Segers
committed
Update tests to match new guidelines
1 parent 60f2e9d commit fc15ec7

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

Tests/FluentAssertions.Json.Specs/JTokenAssertionsSpecs.cs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -967,7 +967,7 @@ public void When_checking_subtree_with_an_invalid_expected_string_it_should_prov
967967
}
968968

969969
[Fact]
970-
public void When_a_float_is_within_approximation_ContainSubtree_check_should_succeed()
970+
public void Assert_property_with_approximation_succeeds()
971971
{
972972
// Arrange
973973
var actual = JToken.Parse("{ \"id\": 1.1232 }");
@@ -980,18 +980,19 @@ public void When_a_float_is_within_approximation_ContainSubtree_check_should_suc
980980
}
981981

982982
[Fact]
983-
public void When_a_float_is_not_within_approximation_ContainSubtree_check_should_throw()
983+
public void Can_assert_on_a_field_with_approximation()
984984
{
985985
// Arrange
986986
var actual = JToken.Parse("{ \"id\": 1.1232 }");
987987
var expected = JToken.Parse("{ \"id\": 1.1235 }");
988988

989-
// Act & Assert
990-
actual.Should().
991-
Invoking(x => x.ContainSubtree(expected, options => options
992-
.Using<double>(d => d.Subject.Should().BeApproximately(d.Expectation, 1e-5))
993-
.WhenTypeIs<double>()))
994-
.Should().Throw<XunitException>()
989+
// Act
990+
Action act = () => actual.Should().ContainSubtree(expected, options => options
991+
.Using<double>(d => d.Subject.Should().BeApproximately(d.Expectation, 1e-5))
992+
.WhenTypeIs<double>());
993+
994+
// Assert
995+
act.Should().Throw<XunitException>()
995996
.WithMessage("JSON document has a different value at $.id.*");
996997
}
997998

0 commit comments

Comments
 (0)