/// <summary> /// Initializes a new instance of the <see cref="Mock{T}"/> class. /// </summary> internal Mock(ControlledRuntime runtime, T value) : base(value) { this.Runtime = runtime; this.RegisterActor = this.Runtime.CreateActor(typeof(SharedRegisterActor <T>)); this.Runtime.SendEvent(this.RegisterActor, SharedRegisterEvent.SetEvent(value)); }
/// <summary> /// Initializes a new instance of the <see cref="MockStateMachineManager"/> class. /// </summary> internal MockStateMachineManager(ControlledRuntime runtime, StateMachine instance, EventGroup group) { this.Runtime = runtime; this.Instance = instance; this.IsEventHandlerRunning = true; this.ProgramCounter = 0; this.CurrentEventGroup = group; }
/// <summary> /// Initializes a new instance of the <see cref="MockStateMachineManager"/> class. /// </summary> internal MockStateMachineManager(ControlledRuntime runtime, StateMachine instance, Guid operationGroupId) { this.Runtime = runtime; this.Instance = instance; this.IsEventHandlerRunning = true; this.OperationGroupId = operationGroupId; this.ProgramCounter = 0; }
/// <summary> /// Initializes a new instance of the <see cref="MockActorManager"/> class. /// </summary> internal MockActorManager(ControlledRuntime runtime, Actor instance, Guid operationGroupId) { this.Runtime = runtime; this.Instance = instance; this.IsEventHandlerRunning = true; this.OperationGroupId = operationGroupId; this.ProgramCounter = 0; this.IsTransitionStatementCalledInCurrentAction = false; this.IsInsideOnExit = false; }
/// <summary> /// Initializes a new instance of the <see cref="Mock"/> class. /// </summary> internal Mock(int value, ControlledRuntime runtime) : base(value) { this.Runtime = runtime; this.CounterActor = this.Runtime.CreateActor(typeof(SharedCounterActor)); var op = this.Runtime.Scheduler.GetExecutingOperation <ActorOperation>(); this.Runtime.SendEvent(this.CounterActor, SharedCounterEvent.SetEvent(op.Actor.Id, value)); op.Actor.ReceiveEventAsync(typeof(SharedCounterResponseEvent)).Wait(); }
/// <summary> /// Initializes a new instance of the <see cref="MockActorManager"/> class. /// </summary> internal MockActorManager(ControlledRuntime runtime, Actor instance, EventGroup group) { this.Runtime = runtime; this.Instance = instance; this.IsEventHandlerRunning = true; this.ProgramCounter = 0; this.IsTransitionStatementCalledInCurrentAction = false; this.IsInsideOnExit = false; this.CurrentEventGroup = group; }
/// <summary> /// Initializes a new instance of the <see cref="Mock{TKey, TValue}"/> class. /// </summary> internal Mock(ControlledRuntime runtime, IEqualityComparer <TKey> comparer) : base(null) { this.Runtime = runtime; if (comparer != null) { this.DictionaryActor = this.Runtime.CreateActor( typeof(SharedDictionaryActor <TKey, TValue>), SharedDictionaryEvent.InitializeEvent(comparer)); } else { this.DictionaryActor = this.Runtime.CreateActor(typeof(SharedDictionaryActor <TKey, TValue>)); } }