Skip to content

Commit cff9df6

Browse files
test
Updating the multi-client test.
1 parent 3a06511 commit cff9df6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

testproject/Assets/Tests/Runtime/MultiClientConnectionApproval.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ public class MultiClientConnectionApproval
2222
private bool m_DelayedApproval;
2323
private List<NetworkManager.ConnectionApprovalResponse> m_ResponseToSet = new List<NetworkManager.ConnectionApprovalResponse>();
2424

25+
private const string k_DisconnectMessage = "Some valid reason";
26+
2527
[OneTimeSetUp]
2628
public void OneTimeSetup()
2729
{
@@ -180,7 +182,7 @@ private IEnumerator ConnectionApprovalHandler(int numClients, int failureTestCou
180182

181183
foreach (var c in clientsToClean)
182184
{
183-
Assert.AreEqual(c.DisconnectReason, "Some valid reason");
185+
Assert.IsTrue(c.DisconnectReason.Contains(k_DisconnectMessage), $"The disconnect message ({c.DisconnectReason}) does not contain the disconnect information ({k_DisconnectMessage})!");
184186
}
185187

186188
foreach (var client in clients)
@@ -242,7 +244,7 @@ private void ConnectionApprovalCallback(NetworkManager.ConnectionApprovalRequest
242244
}
243245
if (!response.Approved)
244246
{
245-
response.Reason = "Some valid reason";
247+
response.Reason = k_DisconnectMessage;
246248
}
247249
else
248250
{

0 commit comments

Comments
 (0)