ActorTestingFramework.Safety.Assert C# (CSharp) Method

Assert() private method

private Assert ( bool condition ) : void
condition bool
return void
        public static void Assert(bool condition)
        {
            Trace.Assert(condition);
        }
    }

Usage Example

Beispiel #1
0
        public T Receive()
        {
            if (Task.CurrentId == null)
            {
                throw new InvalidOperationException("Tried to receive from a non-Task context");
            }
            if (Task.CurrentId.Value != ownerActorInfo.task.Id)
            {
                throw new InvalidOperationException("Only the owner can receive from a Mailbox");
            }

            if (mailbox.Count <= 0)
            {
                Safety.Assert(waiter == null);
                waiter = runtime.GetCurrentActorInfo();
                Safety.Assert(waiter.enabled);
                waiter.enabled = false;
            }

            runtime.Schedule(OpType.RECEIVE);

            Safety.Assert(mailbox.Count > 0);
            Safety.Assert(waiter == null);

            var res = mailbox[0];

            mailbox.RemoveAt(0);
            return(res);
        }
All Usage Examples Of ActorTestingFramework.Safety::Assert
Safety