Beispiel #1
0
        public void TestValidationtarget()
        {
            var baseFolderPath = "Assets/VitDeck/Validator/Tests";
            var assetGuids     = new string[] { "testguid" };
            var assetPaths     = new string[] { "testPath", "testPath2" };
            var assetObjects   = new Object[] { };
            var scenes         = new Scene[] { new Scene() };
            var rootObjects    = new GameObject[] { };
            var allObjects     = new GameObject[] { };
            var target         = new ValidationTarget(baseFolderPath,
                                                      assetGuids,
                                                      assetPaths,
                                                      assetObjects,
                                                      scenes,
                                                      rootObjects,
                                                      allObjects);

            Assert.That(target.GetBaseFolderPath(), Is.EqualTo(baseFolderPath));
            Assert.That(target.GetAllAssetGuids(), Is.EqualTo(assetGuids));
            Assert.That(target.GetAllAssetPaths(), Is.EqualTo(assetPaths));
            Assert.That(target.GetAllAssets(), Is.EqualTo(assetObjects));
            Assert.That(target.GetScenes(), Is.EqualTo(scenes));
            Assert.That(target.GetRootObjects(), Is.EqualTo(rootObjects));
            Assert.That(target.GetAllObjects(), Is.EqualTo(allObjects));
        }
Beispiel #2
0
        public void TestValidationtargetError()
        {
            var target = new ValidationTarget("Assets/VitDeck/Validator/Tests");

            Assert.That(() => target.GetAllAssetGuids(),
                        Throws.Exception.TypeOf <FatalValidationErrorException>()
                        .And.Message.EqualTo("Faild to get asset GUIDs."));
            Assert.That(() => target.GetAllAssetPaths(),
                        Throws.Exception.TypeOf <FatalValidationErrorException>()
                        .And.Message.EqualTo("Faild to get asset Paths."));
            Assert.That(() => target.GetAllAssets(),
                        Throws.Exception.TypeOf <FatalValidationErrorException>()
                        .And.Message.EqualTo("Faild to get asset Objects."));
            Assert.That(() => target.GetScenes(),
                        Throws.Exception.TypeOf <FatalValidationErrorException>()
                        .And.Message.EqualTo("Faild to get scenes."));
            Assert.That(() => target.GetRootObjects(),
                        Throws.Exception.TypeOf <FatalValidationErrorException>()
                        .And.Message.EqualTo("Faild to get root objects."));
            Assert.That(() => target.GetAllObjects(),
                        Throws.Exception.TypeOf <FatalValidationErrorException>()
                        .And.Message.EqualTo("Faild to get all objects."));
        }