diff --git a/Src/FluentAssertions.Json/JTokenAssertions.cs b/Src/FluentAssertions.Json/JTokenAssertions.cs
index 19f82151..0331a5d2 100644
--- a/Src/FluentAssertions.Json/JTokenAssertions.cs
+++ b/Src/FluentAssertions.Json/JTokenAssertions.cs
@@ -27,7 +27,7 @@ static JTokenAssertions()
/// Initializes a new instance of the class.
///
/// The subject
- ///
+ /// The assertion chain
public JTokenAssertions(JToken subject, AssertionChain assertionChain)
: base(subject, assertionChain)
{
@@ -437,15 +437,17 @@ public AndConstraint HaveCount(int expected, string because =
///
/// This example asserts the values of multiple properties of a child object within a JSON document.
///
- /// var json = JToken.Parse("{ success: true, data: { id: 123, type: 'my-type', name: 'Noone' } }");
- /// json.Should().ContainSubtree(JToken.Parse("{ success: true, data: { type: 'my-type', name: 'Noone' } }"));
+ /// var json = JToken.Parse("{ success: true, data: { id: 123, type: 'my-type', name: 'None' } }");
+ /// json.Should().ContainSubtree(JToken.Parse("{ success: true, data: { type: 'my-type', name: 'None' } }"));
///
///
- /// This example asserts that a within a has at least one element with at least the given properties
+ ///
+ /// This example asserts that a within a has at least one element with at least the given properties
///
/// var json = JToken.Parse("{ id: 1, items: [ { id: 2, type: 'my-type', name: 'Alpha' }, { id: 3, type: 'other-type', name: 'Bravo' } ] }");
/// json.Should().ContainSubtree(JToken.Parse("{ items: [ { type: 'my-type', name: 'Alpha' } ] }"));
///
+ ///
public AndConstraint ContainSubtree(string subtree, string because = "", params object[] becauseArgs)
{
JToken subtreeToken;
@@ -482,20 +484,45 @@ public AndConstraint ContainSubtree(string subtree, string bec
///
/// This example asserts the values of multiple properties of a child object within a JSON document.
///
- /// var json = JToken.Parse("{ success: true, data: { id: 123, type: 'my-type', name: 'Noone' } }");
- /// json.Should().ContainSubtree(JToken.Parse("{ success: true, data: { type: 'my-type', name: 'Noone' } }"));
+ /// var json = JToken.Parse("{ success: true, data: { id: 123, type: 'my-type', name: 'None' } }");
+ /// json.Should().ContainSubtree(JToken.Parse("{ success: true, data: { type: 'my-type', name: 'None' } }"));
///
///
- /// This example asserts that a within a has at least one element with at least the given properties
+ ///
+ /// This example asserts that a within a has at least one element with at least the given properties
///
/// var json = JToken.Parse("{ id: 1, items: [ { id: 2, type: 'my-type', name: 'Alpha' }, { id: 3, type: 'other-type', name: 'Bravo' } ] }");
/// json.Should().ContainSubtree(JToken.Parse("{ items: [ { type: 'my-type', name: 'Alpha' } ] }"));
///
+ ///
public AndConstraint ContainSubtree(JToken subtree, string because = "", params object[] becauseArgs)
{
return BeEquivalentTo(subtree, true, options => options, because, becauseArgs);
}
+ ///
+ /// Recursively asserts that the current contains at least the properties or elements of the specified .
+ ///
+ /// The subtree to search for
+ /// The options to consider while asserting values
+ ///
+ /// A formatted phrase as is supported by explaining why the assertion
+ /// is needed. If the phrase does not start with the word because, it is prepended automatically.
+ ///
+ ///
+ /// Zero or more objects to format using the placeholders in .
+ ///
+ /// Use this method to match the current against an arbitrary subtree,
+ /// permitting it to contain any additional properties or elements. This way we can test multiple properties on a at once,
+ /// or test if a contains any items that match a set of properties, assert that a JSON document has a given shape, etc.
+ public AndConstraint ContainSubtree(JToken subtree,
+ Func, IJsonAssertionOptions