JsonNodeTests ExtractSomeDataValue Method Delta Engine Documentation

Namespace: DeltaEngine.Content.Json.Tests
Assembly: DeltaEngine.Content.Json.Tests (in DeltaEngine.Content.Json.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public void ExtractSomeDataValue()
Examples

[Test]
public void ExtractSomeDataValue()
{
    var json = new JsonNode("{ \"SomeData\":6 }");
    Assert.AreEqual(1, json.NumberOfNodes);
    Assert.AreEqual(6, json.Get<int>("SomeData"));
    Assert.Throws<JsonNode.NodeNotFound>(() => json.Get<int>("blah"));
}
See Also