Method ToJson NamespaceXunit.Sdk Assemblyxunit.v3.common.dll ToJson() Converts the given object to JSON. string? ToJson() Returns string Returns the object in JSON form, if possible; returns null if the object cannot be represented in JSON form.