diff --git a/Tests/TestCesium3DTileset.cs b/Tests/TestCesium3DTileset.cs index 74c5adfc..af094e6c 100644 --- a/Tests/TestCesium3DTileset.cs +++ b/Tests/TestCesium3DTileset.cs @@ -126,4 +126,21 @@ public IEnumerator SampleHeightMostDetailedIndicatesNotSampledForPositionOutside Assert.AreEqual(result.longitudeLatitudeHeightPositions[0].y, -33.87100, 1e-12); Assert.AreEqual(result.longitudeLatitudeHeightPositions[0].z, 1.0, 1e-12); } + + [UnityTest] + public IEnumerator SampleHeightMostDetailedFailsIfTilesetFailsToLoad() + { + GameObject go = new GameObject(); + go.name = "Invalid"; + Cesium3DTileset tileset = go.AddComponent(); + tileset.tilesetSource = CesiumDataSource.FromUrl; + tileset.url = "http://localhost/notgonnawork"; + + Task task = tileset.SampleHeightMostDetailed(new double3(151.20972, -33.87100, 1.0)); + + yield return new WaitForTask(task); + + Assert.NotNull(task.Exception); + Assert.IsTrue(task.Exception.Message.Contains("failed to load")); + } } \ No newline at end of file