@@ -9,28 +9,34 @@ namespace FbxExporters.UnitTests
9
9
{
10
10
public class RotationCurveTest : ExporterTestBase {
11
11
12
- private void TestRotationCurveBasics < T > ( ) where T : RotationCurve {
13
-
14
- }
15
-
16
- [ Test ]
17
- public void TestQuaternionBasics ( ) {
18
-
19
- }
20
-
21
12
[ Test ]
22
- public void TestEulerBasics ( ) {
13
+ public void TestBasics ( ) {
23
14
// Test get euler index
24
15
var eulerCurve = new EulerCurve ( ) ;
25
16
Assert . That ( EulerCurve . GetEulerIndex ( "localEulerAnglesRaw.y" ) , Is . EqualTo ( 1 ) ) ;
26
17
Assert . That ( EulerCurve . GetEulerIndex ( "localEulerAnglesRaw." ) , Is . EqualTo ( - 1 ) ) ;
27
- Assert . That ( EulerCurve . GetEulerIndex ( "Quaternion .x" ) , Is . EqualTo ( - 1 ) ) ;
18
+ Assert . That ( EulerCurve . GetEulerIndex ( "m_LocalRotation .x" ) , Is . EqualTo ( - 1 ) ) ;
28
19
29
20
// Test get quaternion index
21
+ var quaternionCurve = new QuaternionCurve ( ) ;
22
+ Assert . That ( QuaternionCurve . GetQuaternionIndex ( "m_LocalRotation.w" ) , Is . EqualTo ( 3 ) ) ;
23
+ Assert . That ( QuaternionCurve . GetQuaternionIndex ( "m_LocalRotation" ) , Is . EqualTo ( - 1 ) ) ;
24
+ Assert . That ( QuaternionCurve . GetQuaternionIndex ( "localEulerAnglesRaw.y" ) , Is . EqualTo ( - 1 ) ) ;
30
25
31
26
// Test SetCurve
27
+ var animCurve = new AnimationCurve ( ) ;
28
+
29
+ eulerCurve . SetCurve ( 2 , animCurve ) ;
30
+ Assert . That ( eulerCurve . m_curves [ 2 ] , Is . EqualTo ( animCurve ) ) ;
31
+
32
+ Assert . That ( ( ) => eulerCurve . SetCurve ( - 1 , animCurve ) , Throws . Exception . TypeOf < System . IndexOutOfRangeException > ( ) ) ;
33
+ Assert . That ( ( ) => eulerCurve . SetCurve ( 3 , animCurve ) , Throws . Exception . TypeOf < System . IndexOutOfRangeException > ( ) ) ;
32
34
35
+ quaternionCurve . SetCurve ( 3 , animCurve ) ;
36
+ Assert . That ( quaternionCurve . m_curves [ 3 ] , Is . EqualTo ( animCurve ) ) ;
33
37
38
+ Assert . That ( ( ) => quaternionCurve . SetCurve ( - 5 , animCurve ) , Throws . Exception . TypeOf < System . IndexOutOfRangeException > ( ) ) ;
39
+ Assert . That ( ( ) => quaternionCurve . SetCurve ( 4 , animCurve ) , Throws . Exception . TypeOf < System . IndexOutOfRangeException > ( ) ) ;
34
40
}
35
41
}
36
42
}
0 commit comments