Пример #1
0
        public void TestFindNoObject()
        {
            var testFolder  = "Assets/VitDeck/Validator/Tests/ValidationTargetFinderNoObject";
            var finder      = new ValidationTargetFinder();
            var rootObjects = finder.FindRootObjects(testFolder, true);

            Assert.That(rootObjects.Length, Is.EqualTo(0));
            var allObjects = finder.FindAllObjects(testFolder, true);

            Assert.That(allObjects.Length, Is.EqualTo(0));
        }
Пример #2
0
        public void TestInvalidPath()
        {
            var finder = new ValidationTargetFinder();
            var path   = "invalidPath";

            Assert.That(finder.FindAssetPaths(path), Is.Null);
            Assert.That(finder.FindAssetGuids(path), Is.Null);
            Assert.That(finder.FindAssetObjects(path), Is.Null);
            Assert.That(finder.FindScenes(path), Is.Null);
            Assert.That(finder.FindRootObjects(path), Is.Null);
            Assert.That(finder.FindAllObjects(path), Is.Null);
        }
Пример #3
0
        public void TestFindRootObjects()
        {
            var testFolder  = "Assets/VitDeck/Validator/Tests/ValidationTargetFinder";
            var finder      = new ValidationTargetFinder();
            var rootObjects = finder.FindRootObjects(testFolder, true);

            //New Scene
            Assert.That(rootObjects.Length, Is.EqualTo(3));
            Assert.That(Array.Exists(rootObjects, obj => obj.name == "Cube(main)"), Is.True);
            Assert.That(Array.Exists(rootObjects, obj => obj.name == "Directional Light"), Is.True);
            Assert.That(Array.Exists(rootObjects, obj => obj.name == "Main Camera"), Is.True);
        }