/// <summary> /// Throws a <see cref="NotSupportedException"/> for the specified unsupported method. /// </summary> /// <param name="methodName">The name of the invoked method that is not supported.</param> public static void ThrowNotSupportedInvocationException(string methodName) { // Do not throw any exception while Delay Fuzzing. if (CoyoteRuntime.IsExecutionControlled && CoyoteRuntime.Current.SchedulingPolicy != SchedulingPolicy.Fuzzing) { // If Relaxed CCT is enabled, we should switch the Scheduling Policy to Delay fuzzing. CoyoteRuntime.CheckAndSetSchedulerStrategyToDelayFuzzing(); throw new NotSupportedException($"Invoking '{methodName}' is not supported during systematic testing."); } }
/// <summary> /// Initializes a new instance of the <see cref="TaskOperation"/> class. /// </summary> internal TaskOperation(ulong operationId, string name, CoyoteRuntime runtime) : base(operationId, name) { this.Runtime = runtime; this.JoinDependencies = new HashSet <Task>(); }
/// <inheritdoc/> public void Dispose() { this.Runtime = null; }
/// <summary> /// Initializes a new instance of the <see cref="ControlledSynchronizationContext"/> class. /// </summary> internal ControlledSynchronizationContext(CoyoteRuntime runtime) { this.Runtime = runtime; }
/// <summary> /// Initializes a new instance of the <see cref="ControlledTaskScheduler"/> class. /// </summary> public ControlledTaskScheduler(CoyoteRuntime runtime) { this.Runtime = runtime; }
/// <summary> /// Initializes a new instance of the <see cref="Resource"/> class. /// </summary> internal Resource() { this.Runtime = CoyoteRuntime.Current; this.AwaitingOperations = new HashSet <AsyncOperation>(); }
/// <summary> /// Assigns the specified runtime as the default global runtime. /// </summary> internal static void AssignGlobalRuntime(CoyoteRuntime runtime) => DefaultInstance = runtime;
/// <summary> /// Assigns the specified runtime as the default for the current asynchronous control flow. /// </summary> internal static void AssignAsyncControlFlowRuntime(CoyoteRuntime runtime) => AsyncLocalInstance.Value = runtime;