dy211
asked on
How do I validate JSON using C#/Xunit?
After spending two days of research on the simple validation of XML in Xunit (since noone was willing to help with my previous XML validating question), I've finally by myself written a very simple XML syntax validation code in C#. (code SIMPLIFIED EVEN FURTHER below)
Now I am faced with the same problem but this time is validation of JSON.
Please consider the code below and help me with write a simple and straight-forward solution just like the XML validation.
THANKS.
PS, I apologize if I sound a tad rude in my question, but I am losing patient with this PAID website.
Now I am faced with the same problem but this time is validation of JSON.
Please consider the code below and help me with write a simple and straight-forward solution just like the XML validation.
THANKS.
PS, I apologize if I sound a tad rude in my question, but I am losing patient with this PAID website.
using System;
using Xunit;
using System.Xml;
public class XMLisValid
{
[Fact]
public void testXMLValid(string source)
{
XmlDocument doc = new XmlDocument();
Assert.DoesNotThrow(
delegate
{
doc.Load(source);
});
}
}
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.