Inheritance Hierarchy
DeltaEngine.Content.Json.Tests JsonFileTests
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
The JsonFileTests type exposes the following members.
Constructors
Name | Description | |
---|---|---|
![]() | JsonFileTests | Initializes a new instance of the JsonFileTests class |
Methods
Name | Description | |
---|---|---|
![]() | CreateFileToLoad | |
![]() | LoadingJsonWithoutFileIsNotAllowed | |
![]() | LoadingNonexistingFileIsNotAllowed | |
![]() | LoadNodeFromTestJson | |
![]() | TestJsonHasOneNode |
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("")); }
[Test] public void LoadingNonexistingFileIsNotAllowed() { Assert.Throws<JsonFile.FileNotFound>(() => new JsonFile("NonExistingFile.json")); }
See Also