From 063066d15bb99bd77f022e4d31eaec97f97b2c61 Mon Sep 17 00:00:00 2001 From: Andrey Davydov Date: Fri, 15 Mar 2024 10:51:43 +0100 Subject: [PATCH] use RdTask.GetAwaiter in AsyncRdTaskTest --- rd-net/Test.RdFramework/AsyncRdTaskTest.cs | 26 ++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/rd-net/Test.RdFramework/AsyncRdTaskTest.cs b/rd-net/Test.RdFramework/AsyncRdTaskTest.cs index 61686c846..95cfc0fb4 100644 --- a/rd-net/Test.RdFramework/AsyncRdTaskTest.cs +++ b/rd-net/Test.RdFramework/AsyncRdTaskTest.cs @@ -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; @@ -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) =>