public static TestSucceedingJSON ( string str ) : CBORObject | ||
str | string | |
Résultat | CBORObject |
public static CBORObject TestSucceedingJSON(string str)
{
byte[] bytes = DataUtilities.GetUtf8Bytes(str, false);
try {
using (var ms = new MemoryStream(bytes)) {
CBORObject obj = CBORObject.ReadJSON(ms);
TestCommon.CompareTestEqualAndConsistent(
obj,
CBORObject.FromJSONString(str));
CBORTestCommon.AssertRoundTrip(obj);
return obj;
}
} catch (Exception ex) {
Assert.Fail(ex.ToString());
throw new InvalidOperationException(String.Empty, ex);
}
}