Class NetworkTimeSystemTests
Runtime tests to test the network time system with the Unity player loop.
Inherited Members
Namespace: Unity.Netcode.RuntimeTests
Assembly: Unity.Netcode.RuntimeTests.dll
Syntax
public class NetworkTimeSystemTests
Methods
CorrectAmountTicksTest()
Tests whether the time system invokes the correct amount of ticks over a period of time. Note we cannot test against Time.Time directly because of floating point precision. Our time is more precise leading to different results.
Declaration
[UnityTest]
public IEnumerator CorrectAmountTicksTest()
Returns
Type | Description |
---|---|
IEnumerator | An IEnumerator for the UnityTest coroutine. |
PlayerLoopFixedTimeTest()
Tests whether time is accessible and has correct values inside Update/FixedUpdate. This test applies only when timeScale is 1.
Declaration
[UnityTest]
public IEnumerator PlayerLoopFixedTimeTest()
Returns
Type | Description |
---|---|
IEnumerator | An IEnumerator for the UnityTest coroutine that validates time values in the player loop. |
PlayerLoopTimeTest_WithDifferentTimeScale(float)
Tests whether time is accessible and has correct values inside Update, for multiples timeScale values.
Declaration
[UnityTest]
public IEnumerator PlayerLoopTimeTest_WithDifferentTimeScale(float timeScale)
Parameters
Type | Name | Description |
---|---|---|
float | timeScale |
Returns
Type | Description |
---|---|
IEnumerator | An IEnumerator for the UnityTest coroutine that validates time values under different time scales. |
Setup()
Declaration
[SetUp]
public void Setup()
TearDown()
Declaration
[TearDown]
public void TearDown()