Add a first batch of automated tests

This commit is contained in:
Haï~
2023-09-03 15:01:01 +02:00
parent dfbabc55a3
commit 27399ae25b
26 changed files with 2164 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
{
"name": "AacEditModeTests",
"references": [
"UnityEngine.TestRunner",
"UnityEditor.TestRunner",
"AnimatorAsCodeFramework"
],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": true,
"precompiledReferences": [
"nunit.framework.dll",
"VRCSDKBase.dll",
"VRCSDK3A.dll"
],
"autoReferenced": false,
"defineConstraints": [
"UNITY_INCLUDE_TESTS"
],
"versionDefines": [],
"noEngineReferences": false
}
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 2a8152e7670c1814abad041ff22b7994
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,50 @@
using System;
using AnimatorAsCode.V0;
using NUnit.Framework;
using UnityEditor;
using UnityEditor.Animations;
using UnityEngine;
using Object = UnityEngine.Object;
namespace av3_animator_as_code.Tests.EditMode
{
public abstract class AbstractSimpleSingleLayerAnimatorInternalEditModeAC
{
protected GameObject _root;
private AnimatorController _container;
private string _containerPath;
[SetUp]
public void SetUp()
{
_root = new GameObject("Root");
_container = new AnimatorController();
_containerPath = $"Assets/temp_aac_test__{Guid.NewGuid()}.asset";
AssetDatabase.CreateAsset(_container, _containerPath);
}
[TearDown]
public void TearDown()
{
Object.DestroyImmediate(_root);
AssetDatabase.DeleteAsset(_containerPath);
_root = null;
_container = null;
_containerPath = null;
}
protected AacFlBase TestAac()
{
return AacV0.Create(new AacConfiguration
{
AnimatorRoot = _root.transform,
AssetContainer = _container,
AssetKey = "None",
AvatarDescriptor = null,
DefaultsProvider = new AacDefaultsProvider(),
SystemName = "Test",
DefaultValueRoot = _root.transform
});
}
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 16d5c7dc8b974daf8719f0d02f1e3fb3
timeCreated: 1671470027