I'm writing my first test in unity3d. My objective is to assert that as the player runs, the Z axis remains consistent and the height doesn't change. In other terms, the Character's z
position is consistently a 1
value.
This test continuously fails with the output of:
AssertionException: FloatComparer assertion failed.
Character.Transform.up.z CompareToConstantValue 1 failed. Expected: 1 Actual: 1
Created in
UnityEngine.Debug:LogException(Exception, Object)
UnityTest.ActionBase:Fail(AssertionComponent) (at Assets/UnityTestTools/Assertions/Comparers/ActionBase.cs:93)
UnityTest.Assertions:CheckAssertions(AssertionComponent[]) (at Assets/UnityTestTools/Assertions/Assertions.cs:37)
UnityTest.Assertions:CheckAssertions(AssertionComponent) (at Assets/UnityTestTools/Assertions/Assertions.cs:18)
UnityTest.AssertionComponent:CheckAssertionFor(CheckMethod) (at Assets/UnityTestTools/Assertions/AssertionComponent.cs:251)
UnityTest.AssertionComponent:Update() (at Assets/UnityTestTools/Assertions/AssertionComponent.cs:148)
The expected/actual values are the same so I'm struggling to see what the problem is. Any insight would be appreciated.
Because it's a float, I tried using 1.0
as the constant value with no luck.