Allows json files to be loaded from disk by utilizing the JsonNode parser.
View code on GitHub
Inheritance Hierarchy
DeltaEngine.Content.Json JsonFile
Namespace: DeltaEngine.Content.Json
Assembly: DeltaEngine.Content.Json (in DeltaEngine.Content.Json.dll) Version: 1.1.1.0 (1.1.1)
Syntax
The JsonFile type exposes the following members.
Constructors
Name | Description | |
---|---|---|
JsonFile | Initializes a new instance of the JsonFile class |
Properties
Name | Description | |
---|---|---|
Root |
Remarks
Examples
[Test] public void LoadNodeFromTestJson() { var file = new JsonFile(TestFilename); Assert.AreEqual(6, file.Root.Get<int>("SomeData")); }
[Test] public void TestJsonHasOneNode() { var file = new JsonFile(TestFilename); Assert.AreEqual(1, file.Root.NumberOfNodes); }
[Test] public void LoadingJsonWithoutFileIsNotAllowed() { Assert.Throws<JsonFile.FileNotFound>(() => new JsonFile(null)); Assert.Throws<JsonFile.FileNotFound>(() => new JsonFile("")); }
See Also