public void ExportGameObjects_SceneClosedAfterExport() { var filePath = CreateTmpUsdFile("dummyUsd.usda"); var scene = Scene.Open(filePath); ExportHelpers.ExportGameObjects(new [] { new GameObject("test") }, scene, BasisTransformation.SlowAndSafe); Assert.IsNull(scene.Stage); }
public void ExportGameObjects_InvalidGO() { var filePath = CreateTmpUsdFile("dummyUsd.usda"); var scene = Scene.Open(filePath); Assert.DoesNotThrow(delegate() { ExportHelpers.ExportGameObjects(new GameObject[] { null }, scene, BasisTransformation.SlowAndSafe); }); UnityEngine.TestTools.LogAssert.Expect(LogType.Exception, "NullReferenceException: Object reference not set to an instance of an object"); }
public void ExportGameObjects_ValidGO() { var filePath = CreateTmpUsdFile("dummyUsd.usda"); var scene = Scene.Open(filePath); ExportHelpers.ExportGameObjects(new [] { new GameObject("test") }, scene, BasisTransformation.SlowAndSafe); scene = Scene.Open(filePath); var paths = scene.Stage.GetAllPaths(); Debug.Log(scene.Stage.GetRootLayer().ExportToString()); Assert.AreEqual(2, paths.Count); scene.Close(); }
public void ExportGameObjects_EmptyList() { var filePath = CreateTmpUsdFile("dummyUsd.usda"); var scene = Scene.Open(filePath); var fileInfoBefore = new FileInfo(filePath); Assert.DoesNotThrow(delegate() { ExportHelpers.ExportGameObjects(new GameObject [] {}, scene, BasisTransformation.SlowAndSafe); }); var fileInfoAfter = new FileInfo(filePath); Assert.AreEqual(fileInfoBefore.Length, fileInfoAfter.Length); scene.Close(); }