Exemplo n.º 1
0
 /// <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));
 }
Exemplo n.º 2
0
 /// <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;
 }
Exemplo n.º 3
0
 /// <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;
 }
Exemplo n.º 4
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;
 }
Exemplo n.º 5
0
            /// <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();
            }
Exemplo n.º 6
0
 /// <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;
 }
Exemplo n.º 7
0
 /// <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>));
     }
 }