Skip to content

le-yams/NFluent.Json

Repository files navigation

NFluent.Json

NFluent Extensions for JsonElement.

Check a JsonElement value

Check.That(jsonElement1).HasNullValue();
Check.That(jsonElement2).HasStringValue("foo");
Check.That(jsonElement3).HasIntValue(42);
Check.That(jsonElement4).HasLongValue(2147483648);
Check.That(jsonElement5).HasBoolValue(true);
Check.That(jsonElement6).HasTrueValue();
Check.That(jsonElement7).HasFalseValue();
Check.That(jsonElement7).HasGuidValue(expectedGuid);
Check.That(jsonElement9).HasArrayValue(new[]{1, 2});
Check.That(jsonElement10).HasArrayValueEquivalentTo(new[]{2, 1});

Check the presence of a property

Check.That(jsonElement).HasProperty("foo");

Check the presence and kind of a property

Check.That(jsonElement).HasProperty("foo", JsonValueKind.String);

Check the presence and value of a property

Check.That(jsonElement).HasStringProperty("stringProperty", "value");
Check.That(jsonElement).HasBoolProperty("boolProperty", expectedValue: true);
Check.That(jsonElement).HasIntProperty("intProperty", 42);
Check.That(jsonElement).HasLongProperty("longProperty", 2147483648);
Check.That(jsonElement).HasNullProperty("nullProperty");
Check.That(jsonElement).HasGuidProperty("guidProperty", expectedGuid);
Check.That(jsonElement).HasArrayProperty("arrayProperty", new[] { 1, 2 });
Check.That(jsonElement).HasArrayPropertyEquivalentTo("arrayProperty", new[] { 2, 1 });

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages