Skip to content

Commit

Permalink
use RdTask.GetAwaiter in AsyncRdTaskTest
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreyG committed Mar 15, 2024
1 parent 1869eaf commit 063066d
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions rd-net/Test.RdFramework/AsyncRdTaskTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,24 @@ protected override IScheduler CreateScheduler(bool isServer)
}

[Test]
public void BindableRdCallListTest()
public void BindableRdCallListUseSystemTaskTest()
{
BindableRdCallListTest(TaskKind.System);
}

[Test]
public void BindableRdCallListUseRdTaskTest()
{
BindableRdCallListTest(TaskKind.Rd);
}

private enum TaskKind
{
System,
Rd,
}

private void BindableRdCallListTest(TaskKind taskKind)
{
ClientWire.AutoTransmitMode = true;
ServerWire.AutoTransmitMode = true;
Expand Down Expand Up @@ -52,7 +69,12 @@ public void BindableRdCallListTest()
{
BindToClient(lifetime, callsite, entity_id);

var list = await callsite.Start(lifetime, Unit.Instance).AsTask();
var list = taskKind switch
{
TaskKind.System => await callsite.Start(lifetime, Unit.Instance).AsTask(),
TaskKind.Rd => await callsite.Start(lifetime, Unit.Instance),
_ => throw new ArgumentOutOfRangeException(nameof(taskKind), taskKind, null)
};
var count = 0;

list.View(lifetime, (lt, index, value) =>
Expand Down

0 comments on commit 063066d

Please sign in to comment.