Skip to content

Commit 0895f55

Browse files
committed
Add code docs
1 parent 730e160 commit 0895f55

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

com.unity.netcode.gameobjects/TestHelpers/Runtime/NetcodeIntegrationTest.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1663,12 +1663,27 @@ public bool WaitForConditionOrTimeOutWithTimeTravel(IConditionalPredicate condit
16631663
return success;
16641664
}
16651665

1666+
/// <summary>
1667+
/// Waits until the specified condition returns true or a timeout occurs, then asserts if the timeout was reached.
1668+
/// </summary>
1669+
/// <param name="checkForCondition">A delegate that returns true when the desired condition is met.</param>
1670+
/// <param name="timeoutErrorMessage">The error message to include in the assertion if the timeout is reached.</param>
1671+
/// <param name="timeOutHelper">An optional <see cref="TimeoutHelper"/> to control the timeout period. If null, the default timeout is used.</param>
1672+
/// <returns>An <see cref="IEnumerator"/> for use in Unity coroutines.</returns>
16661673
public IEnumerator WaitForConditionOrAssert(Func<bool> checkForCondition, string timeoutErrorMessage, TimeoutHelper timeOutHelper = null)
16671674
{
16681675
yield return WaitForConditionOrTimeOut(checkForCondition, timeOutHelper);
16691676
AssertOnTimeout(timeoutErrorMessage, timeOutHelper);
16701677
}
16711678

1679+
/// <summary>
1680+
/// Waits until the specified condition returns true or a timeout occurs, then asserts if the timeout was reached.
1681+
/// This overload allows the condition to provide additional error details via a <see cref="StringBuilder"/>.
1682+
/// </summary>
1683+
/// <param name="checkForCondition">A delegate that takes a <see cref="StringBuilder"/> for error details and returns true when the desired condition is met.</param>
1684+
/// <param name="timeoutErrorMessage">The error message to include in the assertion if the timeout is reached. The information on the StringBuilder will be appended on a new line</param>
1685+
/// <param name="timeOutHelper">An optional <see cref="TimeoutHelper"/> to control the timeout period. If null, the default timeout is used.</param>
1686+
/// <returns>An <see cref="IEnumerator"/> for use in Unity coroutines.</returns>
16721687
public IEnumerator WaitForConditionOrAssert(Func<StringBuilder, bool> checkForCondition, string timeoutErrorMessage, TimeoutHelper timeOutHelper = null)
16731688
{
16741689
var errorBuilder = new StringBuilder();

0 commit comments

Comments
 (0)