Class TimeoutFrameCountHelper
This can be used in place of TimeoutHelper if you suspect a test is having issues on a system where the frame rate is running slow than expected and allowing a certain number of frame updates is required.
Inherited Members
Namespace: Unity.Netcode.TestHelpers.Runtime
Assembly: Unity.Netcode.Runtime.Tests.dll
Syntax
public class TimeoutFrameCountHelper : TimeoutHelper
Constructors
TimeoutFrameCountHelper(float, uint)
Constructor
Declaration
public TimeoutFrameCountHelper(float timeOutPeriod = 2, uint tickRate = 30)
Parameters
Type | Name | Description |
---|---|---|
float | timeOutPeriod | Optional timeout period. |
uint | tickRate | Optional tick rate. |
Methods
GetFrameCount()
Returns the number of frames that have occurred.
Declaration
public int GetFrameCount()
Returns
Type | Description |
---|---|
int | Number of frames as an int. |
OnHasTimedOut()
Virtual method returns true or false if timed out.
Declaration
protected override bool OnHasTimedOut()
Returns
Type | Description |
---|---|
bool | true or false |
Overrides
Remarks
Overriding this provides additional conditions to determine if it has timed out.
OnStart()
Virtual method to override in order to setup a derived class when started.
Declaration
protected override void OnStart()
Overrides
OnStop()
Virtual method to override in order to clean up or other related logic when stopped.
Declaration
protected override void OnStop()