示例#1
0
        public async Task ApplyShouldReturnSuccessResponseWhenActionHandlerWasSuccessfullyProcessed()
        {
            // Arrange
            var action = new TestAction(nameof(ApplyShouldReturnNoMatchingActionResponseWhenProviderReturnsFalse));

            Mock.Get(this.reducer)
            .Setup(r => r.TryGetProvider(TestStateId.New, out It.Ref <IActionProvider <TestStateSubject> > .IsAny))
            .Callback(new StateOutputCallback <TestStateSubject>((StateId id, out IActionProvider <TestStateSubject> provider) =>
            {
                provider = this.provider;
            }))
            .Returns(true);

            Mock.Get(this.provider)
            .Setup(p => p.TryGet(out It.Ref <IActionHandler <TestAction, TestStateSubject> > .IsAny))
            .Callback(new ActionOutputCallback <TestAction, TestStateSubject>((out IActionHandler <TestAction, TestStateSubject> handler) =>
            {
                handler = this.handler;
            }))
            .Returns(true);

            Mock.Get(this.handler)
            .Setup(h => h.Execute(action, It.Is <IStateView <TestStateSubject> >(x => x.StateId == TestStateId.New && x.Subject == this.context)))
            .ReturnsAsync(TestStateId.Processing);

            Mock.Get(this.reducer)
            .Setup(r => r.SetState(It.Is <StateId>(x => x.Name == TestStateId.Processing.Name), this.context));

            // Act
            var result = await this.state.Apply(action);

            // Assert
            Assert.Equal(StateResponse.Success.Id, result?.Id);
        }
示例#2
0
        public static void ClassInitialize(TestContext context)
        {
            testAction = new TestAction(context);

            //fjsonContainer = new FakeJsonContainer();
            //MemoryCache mc = new MemoryCache("TestCache");
        }
            public void TriggersOnlyEffectsThatHandleTheDispatchedAction()
            {
                var mockIncompatibleEffect = new Mock <IEffect>();

                mockIncompatibleEffect
                .Setup(x => x.ShouldReactToAction(It.IsAny <IAction>()))
                .Returns(false);
                var mockCompatibleEffect = new Mock <IEffect>();

                mockCompatibleEffect
                .Setup(x => x.ShouldReactToAction(It.IsAny <IAction>()))
                .Returns(true);

                var subject = new Store(BrowserInteropStub);

                subject.AddEffect(mockIncompatibleEffect.Object);
                subject.AddEffect(mockCompatibleEffect.Object);
                BrowserInteropStub._TriggerPageLoaded();

                var action = new TestAction();

                subject.Dispatch(action);

                mockIncompatibleEffect.Verify(x => x.HandleAsync(action, It.IsAny <IDispatcher>()), Times.Never);
                mockCompatibleEffect.Verify(x => x.HandleAsync(action, It.IsAny <IDispatcher>()), Times.Once);
            }
示例#4
0
        private void check(TestAction action, params CheckConditions[] entries)
        {
            AddAssert($"check {action}", () =>
            {
                Assert.Multiple(() =>
                {
                    foreach (var entry in entries)
                    {
                        var testButton = entry.Tester[action];

                        if (!lastEventCounts.TryGetValue(testButton, out var count))
                        {
                            lastEventCounts[testButton] = count = new EventCounts();
                        }

                        count.OnPressedCount  += entry.OnPressedDelta;
                        count.OnReleasedCount += entry.OnReleasedDelta;

                        Assert.AreEqual(count.OnPressedCount, testButton.OnPressedCount, $"{testButton.Concurrency} {testButton.Action}");
                        Assert.AreEqual(count.OnReleasedCount, testButton.OnReleasedCount, $"{testButton.Concurrency} {testButton.Action}");
                    }
                });
                return(true);
            });
        }
示例#5
0
    public void StartAction(TestAction action)
    {
        _action = action;
        if (_action != null)
        {
            if (_action.autoSkip)
            {
                if (_action.delay > 0f)
                {
                    Invoke("EndAction", _action.delay);
                }
                else
                {
                    EndAction();
                }
            }

            if (_action.move)
            {
                if (_action.delay > 0f)
                {
                    Invoke("Move", _action.delay);
                }
                else
                {
                    Move();
                }
            }
        }
    }
示例#6
0
 public void ExecuteCorrectAction()
 {
     // should execute the right actions
     TestAction enter = new TestAction();
     TestAction step = new TestAction();
     TestAction exit = new TestAction();
     origin.SetAction( enter, "enter" );
     origin.SetAction( step, "step" );
     origin.SetAction( exit, "exit" );
     enter.executed = false;
     step.executed = false;
     exit.executed = false;
     // test Enter
     origin.Enter(context);
     UUnitAssert.False( step.executed, 	"only enter should have executed ");
     UUnitAssert.False( exit.executed, 	"only enter should have executed ");
     UUnitAssert.True( enter.executed, 	"enter should have executed");
     enter.executed = false;
     // test step
     origin.Execute(context);
     UUnitAssert.False( enter.executed, 	"only step should have executed ");
     UUnitAssert.False( exit.executed, 	"only step should have executed ");
     UUnitAssert.True( step.executed, 	"step should have executed");
     step.executed = false;
     // test Exit
     origin.Exit(context);
     UUnitAssert.False( enter.executed, 	"only exit should have executed ");
     UUnitAssert.False( step.executed, 	"only exit should have executed ");
     UUnitAssert.True( exit.executed, 	"exit should have executed");
 }
示例#7
0
        public void Test_InvokeActions_any()
        {
            // テスト用トリガソース
            var cause  = new Action <object>((_) => { });
            var source = Observable.FromEvent <object>(h => cause += h, h => cause -= h);

            // テスト対象の準備
            var trigger = new ReactiveTrigger();

            trigger.Source = source;

            // テスト対象のアクションを呼び出すためのトリガ作成
            var element = new DependencyObject();
            var action  = new TestAction();

            trigger.Attach(element);
            trigger.Actions.Add(action);

            // ソースシーケンスへの投入と結果確認
            action.InvokedParameters.Should().BeEmpty();

            action.Reset();
            cause("a");
            action.InvokedParameters.Should().Equal("a");

            action.Reset();
            cause(100);
            action.InvokedParameters.Should().Equal(100);

            action.Reset();
            cause(200);
            cause("c");
            cause(Tuple.Create(123, TimeSpan.FromSeconds(1)));
            action.InvokedParameters.Should().Equal(200, "c", Tuple.Create(123, TimeSpan.FromSeconds(1)));
        }
示例#8
0
        public void Test_Source_OnError()
        {
            // テスト用トリガソース
            var subject = new Subject <int>();

            // テスト対象の準備
            var trigger = new ReactiveTrigger <int>();

            trigger.Source = subject;

            // テスト対象のアクションを呼び出すためのトリガ作成
            var element = new DependencyObject();
            var action  = new TestAction();

            trigger.Attach(element);
            trigger.Actions.Add(action);

            // 適当にシーケンスに値を流す
            action.Reset();
            subject.OnNext(10);
            subject.OnNext(11);
            subject.OnNext(12);
            action.InvokedParameters.Should().AllBeOfType <int>().And.Equal(10, 11, 12);

            // シーケンスをエラー終了する
            subject.OnError(new Exception());
            action.InvokedParameters.Should().AllBeOfType <int>().And.Equal(10, 11, 12);

            // 完了後に値を流してみる
            // これは単に完了したSubjectがOnNextの呼び出しを無視するだけかもしれないが。
            subject.OnNext(20);
            action.InvokedParameters.Should().AllBeOfType <int>().And.Equal(10, 11, 12);
        }
示例#9
0
        public void TestStopOnFailure()
        {
            // make some scripts

            var a   = new TestAction("a");
            var b   = new TestAction("b");
            var c   = new TestAction("c");
            var abc = new TestScript("abc", a, b, c);
            var d   = new TestAction("d");
            var e   = new TestAction("e");
            var f   = new TestAction("f");
            var def = new TestScript("def", d, e, f);

            var q = new ScriptQueue();

            q.Enqueue(new List <Script>()
            {
                abc, def
            });

            q.OnUpdate();
            Assert.IsTrue(a.IsEnqueued && a.IsActive && a.IsStarted);

            // if we stop just action a with the failure flag set, it should stop the entire script
            // and advance to the next one
            abc.StopCurrentAction(false, null);

            Assert.IsTrue(!a.IsEnqueued && !a.IsActive);
            Assert.IsTrue(!abc.IsEnqueued && !abc.IsActive);
            Assert.IsTrue(def.IsActive && d.IsActive);

            // similary stopping the script will just remove it
            def.StopScript(false, null);
            Assert.IsTrue(!def.IsActive && !d.IsActive);
        }
示例#10
0
    public void testActionTypesHaveUniqueIDs()
    {
        var id1 = new GameAction().id;
        var id2 = new TestAction().id;

        Assert.AreNotEqual(id1, id2);
    }
示例#11
0
        public TestResultEventArgs(TestAction action, ResultNode result) : base(action)
        {
            if (result == null)
                throw new ArgumentNullException("result");

            Result = result;
        }
示例#12
0
        public void Msmq_Receive()
        {
            var msmq = DistributedApplication.ClusterChannel as MsmqChannelProvider;

            // init: purge queues
            msmq._receiveQueue.Purge();
            for (var i = 0; i < msmq._sendQueues.Count; i++)
            {
                var sendqueue = msmq._sendQueues[i];
                sendqueue.Purge();
            }

            // send a single message to the receive queue and check if it gets received and executed
            var message = new TestAction();

            var clusterMemberInfo = new ClusterMemberInfo();

            clusterMemberInfo.InstanceID = Guid.NewGuid().ToString();   // ensures message percieved as coming from other source

            message.SenderInfo = clusterMemberInfo;
            Stream messageStream = new BinaryMessageFormatter().Serialize(message);
            var    m             = new System.Messaging.Message(messageStream);

            m.TimeToBeReceived = TimeSpan.FromSeconds(RepositoryConfiguration.MessageRetentionTime);
            m.Formatter        = new System.Messaging.BinaryMessageFormatter();

            _messageReceivedEvent = new AutoResetEvent(false);
            msmq._receiveQueue.Send(m); // send message to receivequeue

            // test for execution: _messageReceived should be set to true
            var received = _messageReceivedEvent.WaitOne(3000);

            Assert.IsTrue(received, "Distributed action was not received/executed within 3 seconds");
        }
        private void check(TestAction action, params CheckConditions[] entries)
        {
            AddAssert($"check {action}", () =>
            {
                Assert.Multiple(() =>
                {
                    foreach (var entry in entries)
                    {
                        var scrollEntry = entry as ScrollCheckConditions;
                        var testButton  = entry.Tester[action];

                        if (!lastEventCounts.TryGetValue(testButton, out var count))
                        {
                            lastEventCounts[testButton] = count = new EventCounts();
                        }

                        count.OnPressedCount  += entry.OnPressedDelta;
                        count.OnReleasedCount += entry.OnReleasedDelta;
                        count.OnScrollCount   += scrollEntry?.OnScrollCount ?? 0;

                        Assert.AreEqual(count.OnPressedCount, testButton.OnPressedCount, $"{testButton.Concurrency} {testButton.Action} OnPressedCount");
                        Assert.AreEqual(count.OnReleasedCount, testButton.OnReleasedCount, $"{testButton.Concurrency} {testButton.Action} OnReleasedCount");

                        if (testButton is ScrollTestButton scrollTestButton && scrollEntry != null)
                        {
                            Assert.AreEqual(count.OnScrollCount, scrollTestButton.OnScrollCount, $"{testButton.Concurrency} {testButton.Action} OnScrollCount");
                            Assert.AreEqual(scrollEntry.LastScrollAmount, scrollTestButton.LastScrollAmount, $"{testButton.Concurrency} {testButton.Action} LastScrollAmount");
                        }
                    }
                });
                return(true);
            });
示例#14
0
        public void ActionDeserializes()
        {
            string     json = DataTest.SampleAction.ToJson();
            TestAction act  = (TestAction)GameAction.FromJson(json);

            Assert.AreEqual(act.TestValue, DataTest.SampleAction.TestValue);
        }
示例#15
0
            public async Task Should_create_DispatchContext_using_dispatchContextFactory()
            {
                var action = new TestAction();
                await sut.DispatchAsync(action, CancellationToken.None);

                _dispatchContextFactory.Verify(x => x.Create(action, sut), Times.Once);
            }
示例#16
0
        protected override TestingObject <OperationManager> GetTestingObject()
        {
            if (_createOp)
            {
                _createdOp = new OperationSetup("TestOperation", "Test", new Dictionary <string, string>
                {
                    { "Test1", "Test1" },
                    { "Test2", "Test2" },
                    { "Test3", "Test3" },
                    { "Test4", "Test4" }
                }, DateTime.Now).ToOperation().ToOperationEntity();
            }

            var opRepo = BuildMock <IOperationRepository>(m => m.Setup(or => or.AddOperation(It.IsAny <OperationEntity>()))
                                                          .Returns(Task.CompletedTask)
                                                          .Callback <OperationEntity>(op => _createdOp = op),
                                                          m => m.Setup(or => or.UpdateOperation(It.IsAny <string>(), It.IsAny <Action <OperationEntity> >()))
                                                          .Returns(Task.CompletedTask)
                                                          .Callback <string, Action <OperationEntity> >(((s, action) => action(_createdOp))),
                                                          m => m.Setup(or => or.Remove(It.Is <string>(e => e == _createdOp.OperationId)))
                                                          .Returns(Task.CompletedTask).Callback(() => _removeCalled = true));

            _testAction = new TestAction();

            var unitMock = BuildMock <IUnitOfWork>(m => m.Setup(u => u.SaveChanges()).Returns(Task.FromResult(0)),
                                                   m => m.Verify(u => u.SaveChanges(), Times.Never),
                                                   m => m.SetupGet(u => u.OperationRepository).Returns(opRepo));

            return(base.GetTestingObject()
                   .AddDependency <IEnumerable <IOperationAction> >(new[] { _testAction })
                   .AddLogger(TestOutputHelper)
                   .AddDependency(unitMock)
                   .AddDependencyWithProvider <IBackgroundTaskDispatcher>(p => new SyncTaskSheduler(p)));
        }
示例#17
0
            public async Task Should_call_managers_in_the_expected_order()
            {
                // Arrange
                var action         = new TestAction();
                var token          = CancellationToken.None;
                var operationQueue = new Queue <string>();

                _interceptorsManager
                .Setup(x => x.DispatchAsync(It.IsAny <IDispatchContext <TestAction> >(), token))
                .Callback(() => operationQueue.Enqueue("Interceptors"));
                _actionHandlersManager
                .Setup(x => x.DispatchAsync(It.IsAny <IDispatchContext <TestAction> >(), token))
                .Callback(() => operationQueue.Enqueue("Reducers"));
                _afterEffectsManager
                .Setup(x => x.DispatchAsync(It.IsAny <IDispatchContext <TestAction> >(), token))
                .Callback(() => operationQueue.Enqueue("AfterEffects"));

                // Act
                await sut.DispatchAsync(action, token);

                // Assert
                Assert.Collection(operationQueue,
                                  operation => Assert.Equal("Interceptors", operation),
                                  operation => Assert.Equal("Reducers", operation),
                                  operation => Assert.Equal("AfterEffects", operation)
                                  );
            }
示例#18
0
        void OnPerform(object sender, object args)
        {
            var action = args as TestAction;
            var marks  = action.orderOfPlay == rootActionOrder ? actionMarks : reactionMarks;

            marks.perform     = true;
            action.didPerform = true;

            if (action.orderOfPlay != rootActionOrder)
            {
                reactions.Add(action);
            }
            else
            {
                AddReactions((IContainer)sender);
            }
            if (action.priority == depthCheckPriority)
            {
                var reaction = new TestAction();
                reaction.orderOfPlay = depthReactionOrder;
                ((IContainer)sender).GetAspect <ActionSystem> ().AddReaction(reaction);
            }
            if (action.orderOfPlay == depthReactionOrder)
            {
                // Expect '2'.  The trigger action and child action,
                // Any greater value indicates that a sibling action of the trigger action responded first
                depthFirst = (reactions.Count == 2);
            }
        }
示例#19
0
        public async Task ShouldReturnSuccessResponse()
        {
            // Arrange
            var action      = new TestAction("TEST");
            var state       = TestStateId.New;
            var resultState = TestStateId.Processing;

            Mock.Get(this.core)
            .SetupGet(c => c.Component)
            .Returns(this.component);

            Mock.Get(this.core)
            .SetupGet(c => c.InitialStateId)
            .Returns(state);

            Mock.Get(this.component)
            .Setup(c => c.Apply(action, state))
            .ReturnsAsync(new StateTransitionResponse(StateMachineResponse.Success, resultState));

            // Act
            var result = await new StateMachine(this.core).Apply(action);

            // Assert
            Assert.Equal(TestStateId.Processing.Name, resultState.Name);
            Assert.Equal(StateMachineResponse.Success.Id, result.Id);
            Assert.Equal(StateMachineResponse.Success.Message, result.Message);
        }
示例#20
0
        private IEnumerable <ITestStep> ExtractSteps(List <List <string> > tableRows)
        {
            var steps = new List <ExcelStep>();

            TestAction lastAction = TestAction.Unknown;

            for (int i = 0; i < tableRows.Count; i++)
            {
                List <string>        row        = tableRows[i];
                IEnumerable <string> rowContent = row.Where(x => !x.IsNullOrEmpty());
                if (rowContent.Any())
                {
                    TestAction currentAction;
                    var        firstValue = rowContent.First().Trim();
                    if (Enum.TryParse(firstValue, out currentAction))
                    {
                        lastAction = currentAction;
                    }

                    if (rowContent.Any(x => ContainsStep(x)))
                    {
                        // Extract the current step and move the index to the next
                        var stepContents = GetCurrentStepContent(tableRows, i, out i);
                        if (!stepContents.IsNullOrEmpty())
                        {
                            steps.Add(new ExcelStep(lastAction, stepContents));
                        }
                    }
                }
            }

            return(this.CreateTestSteps(steps));
        }
示例#21
0
        public async Task ShouldReturnUnknownStateResponseWhenResultResponseIsNull()
        {
            // Arrange
            var action      = new TestAction("TEST");
            var state       = TestStateId.New;
            var resultState = TestStateId.Processing;

            Mock.Get(this.core)
            .SetupGet(c => c.Component)
            .Returns(this.component);

            Mock.Get(this.core)
            .SetupGet(c => c.InitialStateId)
            .Returns(state);

            Mock.Get(this.component)
            .Setup(c => c.Apply(action, state))
            .ReturnsAsync(new StateTransitionResponse(null, resultState));

            // Act
            var result = await new StateMachine(this.core).Apply(action);

            // Assert
            Assert.Equal(TestStateId.Processing.Name, resultState.Name);
            Assert.Equal(StateMachineResponse.UnknownState.Id, result.Id);
            Assert.Equal($"The provided state identification could not find the corresponding state. Provided state-id: {resultState.Name}", result.Message);
        }
示例#22
0
        public void TestActionsInScript()
        {
            // make some actions
            var a = new TestAction("a");
            var b = new TestAction("b");
            var c = new TestAction("c");
            var d = new TestAction("d");
            var e = new TestAction("e");
            var f = new TestAction("f");

            var seq = new TestScript("test");

            seq.Enqueue(new List <Action>()
            {
                a, b, c
            });

            // make sure they're all enqueued but only A is activated
            Assert.IsTrue(!seq.IsEmpty && seq.Head == a);
            Assert.IsTrue(a.IsEnqueued && a.IsActive);
            Assert.IsTrue(b.IsEnqueued && !b.IsActive);
            Assert.IsTrue(c.IsEnqueued && !c.IsActive);

            // stop A, this should dequeue it and activate B
            a.Stop(true);
            Assert.IsTrue(!seq.IsEmpty && seq.Head == b);
            Assert.IsTrue(!a.IsEnqueued && !a.IsActive);
            Assert.IsTrue(b.IsEnqueued && b.IsActive);
            Assert.IsTrue(c.IsEnqueued && !c.IsActive);

            // stop the script, this should pop B and C without activating the latter
            seq.Clear();
            Assert.IsTrue(seq.IsEmpty && seq.Head == null);
            Assert.IsTrue(!a.IsEnqueued && !a.IsActive && a.countActivate == 1 && a.countDeactivate == 1);
            Assert.IsTrue(!b.IsEnqueued && !b.IsActive && b.countActivate == 1 && b.countDeactivate == 1);
            Assert.IsTrue(!c.IsEnqueued && !c.IsActive && c.countActivate == 0 && c.countDeactivate == 0);

            // push two more
            seq.Enqueue(new List <Action>()
            {
                d, e
            });
            Assert.IsTrue(d.IsEnqueued && d.IsActive && d.countActivate == 1 && d.countDeactivate == 0);
            Assert.IsTrue(e.IsEnqueued && !e.IsActive && e.countActivate == 0 && e.countDeactivate == 0);

            // pop E from the end, this should not affect D, or activate/deactivate E
            seq.PopTail();
            Assert.IsTrue(d.IsEnqueued && d.IsActive && d.countActivate == 1 && d.countDeactivate == 0);
            Assert.IsTrue(!e.IsEnqueued && !e.IsActive && e.countActivate == 0 && e.countDeactivate == 0);

            // push F to the front, this should deactivate D but keep it in the queue
            seq.PushHead(f);
            Assert.IsTrue(f.IsEnqueued && f.IsActive && f.countActivate == 1 && f.countDeactivate == 0);
            Assert.IsTrue(d.IsEnqueued && !d.IsActive && d.countActivate == 1 && d.countDeactivate == 1);

            // now dequeue F from the front, this should pop it, and re-activate D
            seq.StopCurrentAction(true, null);
            Assert.IsTrue(!f.IsEnqueued && !f.IsActive && f.countActivate == 1 && f.countDeactivate == 1);
            Assert.IsTrue(d.IsEnqueued && d.IsActive && d.countActivate == 2 && d.countDeactivate == 1);
        }
示例#23
0
        public async Task WhenCalled_ThenTriggersOnlyEffectsThatHandleTheDispatchedAction()
        {
            var mockIncompatibleEffect = new Mock <IEffect>();

            mockIncompatibleEffect
            .Setup(x => x.ShouldReactToAction(It.IsAny <object>()))
            .Returns(false);
            var mockCompatibleEffect = new Mock <IEffect>();

            mockCompatibleEffect
            .Setup(x => x.ShouldReactToAction(It.IsAny <object>()))
            .Returns(true);

            var subject = new TestStore();
            await subject.InitializeAsync();

            subject.AddEffect(mockIncompatibleEffect.Object);
            subject.AddEffect(mockCompatibleEffect.Object);

            var action = new TestAction();

            subject.Dispatch(action);

            mockIncompatibleEffect.Verify(x => x.HandleAsync(action, It.IsAny <IDispatcher>()), Times.Never);
            mockCompatibleEffect.Verify(x => x.HandleAsync(action, It.IsAny <IDispatcher>()), Times.Once);
        }
示例#24
0
        public async Task ShouldReturnSuccessResponse()
        {
            // Arrange
            var input = new TestAction("TEST");
            var state = TestStateId.New;

            this.component.Add(typeof(TestAction).FullName, this.next);
            this.component.Add(typeof(object).FullName, this.defaultComponent);

            Mock.Get(this.next)
            .Setup(n => n.Apply(input, state))
            .ReturnsAsync(new StateTransitionResponse(StateMachineResponse.Success, state));

            // Act
            var result = await this.component.Apply(input, state);

            // Arrange
            Assert.Equal(StateMachineResponse.Success.Id, result.Response.Id);

            Assert.True(this.component.TryGetValue(typeof(TestAction).FullName, out var com1));
            Assert.NotNull(com1);

            Assert.True(this.component.TryGetValue(typeof(object).FullName, out var com2));
            Assert.NotNull(com2);
        }
        public void Test_DragOver_Reject()
        {
            // テスト対象のアクションを呼び出すためのトリガ作成
            var element = new UIElement();
            var action  = new TestAction();

            // テスト対象の準備
            var trigger = new DragDropTerigger();

            trigger.AcceptDropFormats = new[] { DataFormats.FileDrop };
            trigger.AcceptDropEffect  = DragDropEffects.Move;

            // 要素にアタッチ
            trigger.Attach(element);
            trigger.Actions.Add(action);

            // ドロップデータのモック
            var dataMock = new TestDataObject();

            dataMock.Setup_GetDataPresent(DataFormats.FileDrop, () => false);

            // テスト用のイベントパラメータ生成
            var args = TestActivator.CreateDragEventArgs(dataMock.Object, allowedEffects: DragDropEffects.All);

            args.RoutedEvent = UIElement.DragOverEvent;
            args.Effects     = DragDropEffects.Copy;

            // イベントを発生させる
            element.RaiseEvent(args);

            // イベント処理結果検証
            args.Effects.Should().Be(DragDropEffects.None);
        }
示例#26
0
        public void Test_InvokeActions_Detach()
        {
            // テスト用トリガソース
            var cause  = new Action <int>((_) => { });
            var source = Observable.FromEvent <int>(h => cause += h, h => cause -= h);

            // テスト対象の準備
            var trigger = new ReactiveTrigger <int>();

            trigger.Source = source;

            // テスト対象のアクションを呼び出すためのトリガ作成
            var element = new DependencyObject();
            var action  = new TestAction();

            trigger.Attach(element);
            trigger.Actions.Add(action);

            // 一応デタッチ前の状態確認
            action.Reset();
            cause(10);
            action.InvokedParameters.Should().AllBeOfType <int>().And.Equal(10);

            // 要素からデタッチ
            trigger.Detach();

            // 一応デタッチ前の状態確認
            action.Reset();
            cause(30);
            action.InvokedParameters.Should().AllBeOfType <int>().And.Equal(30);
        }
示例#27
0
        public TestCase(string label, TestAction action)
        {
            this.label  = label;
            this.action = action;

            time = 0f;
        }
示例#28
0
        public void Test_InvokeActions_string()
        {
            // テスト用トリガソース
            var cause  = new Action <string>((_) => { });
            var source = Observable.FromEvent <string>(h => cause += h, h => cause -= h);

            // テスト対象の準備
            var trigger = new ReactiveTrigger <string>();

            trigger.Source = source;

            // テスト対象のアクションを呼び出すためのトリガ作成
            var element = new DependencyObject();
            var action  = new TestAction();

            trigger.Attach(element);
            trigger.Actions.Add(action);

            // ソースシーケンスへの投入と結果確認
            action.InvokedParameters.Should().BeEmpty();

            action.Reset();
            cause("a");
            action.InvokedParameters.Should().AllBeOfType <string>().And.Equal("a");

            action.Reset();
            cause("b");
            cause("c");
            cause("c");
            action.InvokedParameters.Should().AllBeOfType <string>().And.Equal("b", "c", "c");
        }
        public void Test_AutoAllowDrop_Enable()
        {
            // テスト対象のアクションを呼び出すためのトリガ作成
            var element = new UIElement();
            var action  = new TestAction();

            // テスト対象の準備
            var trigger = new DragDropTerigger();

            trigger.AcceptDropFormats = new[] { DataFormats.FileDrop };
            trigger.AcceptDropEffect  = DragDropEffects.Move;
            trigger.AutoAllowDrop     = true;

            // 事前の状態チェック
            element.AllowDrop.Should().Be(false);

            // 要素にアタッチ
            trigger.Attach(element);
            trigger.Actions.Add(action);

            // 設定の影響を確認
            element.AllowDrop.Should().Be(true);

            // 要素からデタッチ
            trigger.Detach();

            // 元の設定に戻ることを確認
            element.AllowDrop.Should().Be(false);
        }
示例#30
0
        public void Creating_a_new_allowedaction_object_with_custom_name_should_correctly_set_properties()
        {
            var expectedName = "TestActionName";
            var action       = new TestAction(expectedName);

            Assert.AreEqual(expectedName, action.Name);
        }
示例#31
0
        public void Creating_a_new_allowedaction_object_should_correctly_set_properties()
        {
            var expectedName = nameof(TestAction);
            var action       = new TestAction();

            Assert.AreEqual(expectedName, action.Name);
        }
        // Creates and seeds an ApplicationContext with test data; then calls  test action.
        private async Task PrepareTestContext(TestAction testAction)
        {
            // Database is in memory as long the connection is open
            var connection = new SqliteConnection("DataSource=:memory:");

            try
            {
                connection.Open();

                var options = new DbContextOptionsBuilder <ApplicationContext>()
                              .UseSqlite(connection)
                              .Options;

                // Create the schema in the database and seeds with test data
                using (var context = new ApplicationContext(options))
                {
                    context.Database.EnsureCreated();
                    SeedData.Initialize(context);

                    await testAction(context);
                }
            }
            finally
            {
                connection.Close();
            }
        }
示例#33
0
        public TestEventArgs(TestAction action, ResultNode result)
        {
            if (result == null)
                throw new ArgumentNullException("result");

            this.Action = action;
            this.Result = result;
        }
示例#34
0
        public TestEventArgs(TestAction action, TestNode test)
        {
            if (test == null)
                throw new ArgumentNullException("test");

            this.Action = action;
            this.Test = test;
        }
示例#35
0
        public TestNodeEventArgs(TestAction action, TestNode test)
            : base(action)
        {
            if (test == null)
                throw new ArgumentNullException("test");

            Test = test;
        }
 public PipeLineTestor()
 {
     _Func = new TestFunction<int, int>(a => a * 5);
     _Func2 = new TestFunction<int, int>(a => a - 2);
     _Func3 = new TestFunction<int, int>(a => a + 2);
     _Func4 = new TestFunction<int, int>(a => { Thread.Sleep(300); return a * 3; });
     _Act = new TestAction<int>();
     _Act2 = new TestAction<int>();
     _Act3 = new TestAction<int>(a => { Thread.Sleep(300); });
 }
示例#37
0
        public void TestActionsInScript()
        {
            // make some actions
            var a = new TestAction("a");
            var b = new TestAction("b");
            var c = new TestAction("c");
            var d = new TestAction("d");
            var e = new TestAction("e");
            var f = new TestAction("f");

            var seq = new TestScript("test");
            seq.Enqueue(new List<Action>() { a, b, c });

            // make sure they're all enqueued but only A is activated
            Assert.IsTrue(!seq.IsEmpty && seq.Head == a);
            Assert.IsTrue(a.IsEnqueued && a.IsActive);
            Assert.IsTrue(b.IsEnqueued && !b.IsActive);
            Assert.IsTrue(c.IsEnqueued && !c.IsActive);

            // stop A, this should dequeue it and activate B
            a.Stop(true);
            Assert.IsTrue(!seq.IsEmpty && seq.Head == b);
            Assert.IsTrue(!a.IsEnqueued && !a.IsActive);
            Assert.IsTrue( b.IsEnqueued &&  b.IsActive);
            Assert.IsTrue( c.IsEnqueued && !c.IsActive);

            // stop the script, this should pop B and C without activating the latter
            seq.Clear();
            Assert.IsTrue(seq.IsEmpty && seq.Head == null);
            Assert.IsTrue(!a.IsEnqueued && !a.IsActive && a.countActivate == 1 && a.countDeactivate == 1);
            Assert.IsTrue(!b.IsEnqueued && !b.IsActive && b.countActivate == 1 && b.countDeactivate == 1);
            Assert.IsTrue(!c.IsEnqueued && !c.IsActive && c.countActivate == 0 && c.countDeactivate == 0);

            // push two more
            seq.Enqueue(new List<Action>() { d, e });
            Assert.IsTrue(d.IsEnqueued &&  d.IsActive && d.countActivate == 1 && d.countDeactivate == 0);
            Assert.IsTrue(e.IsEnqueued && !e.IsActive && e.countActivate == 0 && e.countDeactivate == 0);

            // pop E from the end, this should not affect D, or activate/deactivate E
            seq.PopTail();
            Assert.IsTrue( d.IsEnqueued &&  d.IsActive && d.countActivate == 1 && d.countDeactivate == 0);
            Assert.IsTrue(!e.IsEnqueued && !e.IsActive && e.countActivate == 0 && e.countDeactivate == 0);

            // push F to the front, this should deactivate D but keep it in the queue
            seq.PushHead(f);
            Assert.IsTrue(f.IsEnqueued &&  f.IsActive && f.countActivate == 1 && f.countDeactivate == 0);
            Assert.IsTrue(d.IsEnqueued && !d.IsActive && d.countActivate == 1 && d.countDeactivate == 1);

            // now dequeue F from the front, this should pop it, and re-activate D
            seq.StopCurrentAction(true, null);
            Assert.IsTrue(!f.IsEnqueued && !f.IsActive && f.countActivate == 1 && f.countDeactivate == 1);
            Assert.IsTrue( d.IsEnqueued &&  d.IsActive && d.countActivate == 2 && d.countDeactivate == 1);
        }
示例#38
0
 public void ExecuteExitActions()
 {
     // should execute step actions
     TestAction first = new TestAction();
     TestAction second = new TestAction();
     origin.SetAction( first, "exit" );
     origin.SetAction( second, "exit" );
     UUnitAssert.False( first.executed );
     origin.Exit(context);
     UUnitAssert.True( first.executed, "exit actions should have executed");
     UUnitAssert.True( second.executed, "exit actions should have executed");
 }
示例#39
0
        void FocusAndEnter()
        {
            var comment = GetCommentTextBox();
            if (comment == null)
                return;

            comment.Focus();

            var rnd = new Random();
            comment.Text = "comment" + rnd.Next(100);

            _prevAction = TestAction.FocusedAndEdited;
        }
示例#40
0
        public TaskStatusTest(TestParameters parameters)
        {
            _testAction = parameters.TestAction;
            _childCreationOptions = parameters.ChildTaskCreationOptions;
            _createChildTask = parameters.CreateChildTask;
            _isPromise = parameters.IsPromise;

            _finalTaskStatus = parameters.FinalTaskStatus;
            _finalChildTaskStatus = parameters.FinalChildTaskStatus;
            _finalPromiseStatus = parameters.FinalPromiseStatus;

            _mre = new ManualResetEventSlim(false);
            _taskCts = new CancellationTokenSource();
            _childTaskToken = new CancellationToken(false);
        }
示例#41
0
        public void HandleRequest_ForPostRequest_CallsThePostMethodOnTheAction()
        {
            var route = new Route("tests/([a-z]+).html", typeof(TestAction));
            var action = new TestAction();

            var httpContext = Mocked.HttpContext()
                                    .WithRegisteredAction(action)
                                    .WithHttpMethod("POST")
                                    .WithUrl("http://localhost/tests/request.html")
                                    .Mock;

            route.HandleRequest(httpContext);

            Assert.Equal("Post", action.LastMethod);
        }
示例#42
0
        static void Main(string[] args)
        {
            IHistory _history = new WpfHistory();
            _history.Clear();
            TestAction action = new TestAction();
            _history.RecordAction(action);

            Assert.IsFalse(_history.CanUndo);
            Assert.IsFalse(_history.CanRedo);

            _history.ExecutedLastRecordedAction();

            Assert.IsTrue(_history.CanUndo);
            Assert.IsFalse(_history.CanRedo);
            Assert.AreEqual(_history.UndoStackCount, 1);
            Assert.AreEqual(action, _history.UndoAction);
        }
示例#43
0
        public void TestActionStartupAndUpdate()
        {
            // make some actions
            var a = new TestAction("a");
            var b = new TestAction("b");
            var c = new TestAction("c", true); // this one stops before first update
            var seq = new TestScript("test", a, b, c);

            Assert.IsTrue(a.IsEnqueued && a.IsActive && !a.IsStarted);
            Assert.IsTrue(a.countUpdate == 0);

            // fake an update cycle
            seq.OnUpdate();

            Assert.IsTrue(a.IsEnqueued && a.IsActive && a.IsStarted);
            Assert.IsTrue(a.countUpdate == 1);

            // stop. this will remove and deactivate A, and activate B,
            // but not start it yet until an update
            a.Stop(true);
            Assert.IsTrue(!a.IsEnqueued && !a.IsActive && !a.IsStarted);
            Assert.IsTrue( b.IsEnqueued &&  b.IsActive && !b.IsStarted);
            Assert.IsTrue(a.countUpdate == 1);
            Assert.IsTrue(b.countUpdate == 0);

            seq.OnUpdate();
            Assert.IsTrue(b.IsEnqueued && b.IsActive && b.IsStarted);
            Assert.IsTrue(b.countUpdate == 1);

            // stop b. this will activate c, which will stop itself before first update
            b.Stop(true);
            Assert.IsTrue(c.IsEnqueued && c.IsActive && !c.IsStarted);
            Assert.IsTrue(c.countUpdate == 0);
            seq.OnUpdate();
            Assert.IsTrue(!c.IsEnqueued && !c.IsActive && !c.IsStarted);
            Assert.IsTrue(c.countUpdate == 0); // this update never got a chance to run
        }
 public static void Test(int n, TimeUnit timeUnit, out long total, out long avg, TestAction ac)
 {
     Stopwatch sw = new Stopwatch();
     sw.Start();
     for (int i = n; i > 0; --i)
     {
         ac();
     }
     sw.Stop();
     total = sw.ElapsedTicks;
     avg = total / n;
 }
示例#45
0
        public void TestQueueUpdate()
        {
            // make some scripts

            var a = new TestAction("a");
            var b = new TestAction("b");
            var c = new TestAction("c");
            var abc = new TestScript("abc", a, b, c);
            var d = new TestAction("d");
            var e = new TestAction("e");
            var f = new TestAction("f");
            var def = new TestScript("def", d, e, f);

            var q = new ScriptQueue();
            q.Enqueue(new List<Script>() { abc, def });

            Assert.IsTrue(a.IsEnqueued && a.IsActive && !a.IsStarted);

            // fake a queue update
            q.OnUpdate();

            Assert.IsTrue(a.IsEnqueued && a.IsActive && a.IsStarted);

            // stop the script. the first action in the next script
            // will be activated, but won't be started until another update
            q.StopCurrentScript(true, null);
            Assert.IsTrue(!abc.IsEnqueued && !abc.IsActive && !a.IsActive && !a.IsStarted);
            Assert.IsTrue(def.IsEnqueued && def.IsActive && d.IsActive && !d.IsStarted);

            q.OnUpdate();
            Assert.IsTrue(def.IsEnqueued && def.IsActive && d.IsActive && d.IsStarted);

            // clear everything. no more updates
            q.StopAllScripts(true, null);
            Assert.IsTrue(!def.IsEnqueued && !def.IsActive && !d.IsActive && !d.IsStarted);
            Assert.IsTrue(q.IsEmpty);
        }
示例#46
0
        /// <summary>
        /// Reads the JSON representation of the object.
        /// </summary>
        /// <param name="reader">The <see cref="T:Newtonsoft.Json.JsonReader" /> to read from.</param>
        /// <param name="objectType">Type of the object.</param>
        /// <param name="existingValue">The existing value of object being read.</param>
        /// <param name="serializer">The calling serializer.</param>
        /// <returns>
        /// The object value.
        /// </returns>
        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
        {
            ActionBase action = null;
            var condition = Condition.Equals;
            var actionName = string.Empty;
            var path = string.Empty;
            var value = string.Empty;
            var text = string.Empty;
            var expectedValue = string.Empty;
            var expectedText = string.Empty;
            var seconds = 0;

            while (reader.Read() && reader.TokenType != JsonToken.EndObject)
            {
                if (reader.TokenType == JsonToken.PropertyName)
                {
                    switch (reader.Value as string)
                    {
                        case "action":
                            actionName = reader.ReadAsString();
                            break;

                        case "path":
                            path = reader.ReadAsString();
                            break;

                        case "value":
                            value = reader.ReadAsString();
                            break;

                        case "text":
                            text = reader.ReadAsString();
                            break;

                        case "expectedValue":
                            expectedValue = reader.ReadAsString();
                            break;

                        case "expectedText":
                            expectedText = reader.ReadAsString();
                            break;

                        case "condition":
                            condition = (Condition)Enum.Parse(typeof (Condition), reader.ReadAsString(), true);
                            break;

                        case "seconds":
                            seconds = reader.ReadAsInt32() ?? 10;
                            break;
                    }
                }
            }

            switch (actionName)
            {
                case "click":
                    action = new ClickAction { Condition = condition, Path = path, Text = text, Value = value };
                    break;

                case "enterKey":
                    action = new EnterKeyAction { Condition = condition, Path = path, Text = text, Value = value };
                    break;

                case "navigateTo":
                    action = new NavigateToAction { Path = path };
                    break;

                case "selectItem":
                    action = new SelectItemAction { Condition = condition, Path = path, Text = text, Value = value };
                    break;

                case "setText":
                    action = new SetTextAction { Path = path, Value = value };
                    break;

                case "test":
                    action = new TestAction { Condition = condition, Path = path, ExpectedText = expectedText, ExpectedValue = expectedValue };
                    break;

                case "wait":
                    action = new WaitAction { Seconds = seconds };
                    break;
            }

            return action;
        }
示例#47
0
        public void TestScriptsInQueue()
        {
            // make some scripts

            var a = new TestAction("a");
            var b = new TestAction("b");
            var c = new TestAction("c");
            var abc = new TestScript("abc", a, b, c);
            var empty = new TestScript("empty");
            var d = new TestAction("d");
            var e = new TestAction("e");
            var f = new TestAction("f");
            var def = new TestScript("def", d, e, f );

            var q = new ScriptQueue();
            q.Enqueue(new List<Script>() { abc, empty, def });

            // verify the first script and action are active
            Assert.IsTrue(!q.IsEmpty && q.Head == abc && q.Head.Head == a);
            Assert.IsTrue(  abc.IsEnqueued &&  abc.IsActive);
            Assert.IsTrue(empty.IsEnqueued && !empty.IsActive);
            Assert.IsTrue(  def.IsEnqueued && !def.IsActive);

            // stop the first action, keeps the same script active
            a.Stop(true);
            Assert.IsTrue(!q.IsEmpty && q.Head == abc && q.Head.Head == b);

            // finish off actions. this will remove ABC from the queue
            b.Stop(true);
            c.Stop(true);
            Assert.IsTrue(!q.IsEmpty && q.Head != abc);
            Assert.IsTrue(abc.countActivate == 1 && abc.countDeactivate == 1);

            // the Empty script was activated but then immediately removed, because it's empty
            Assert.IsTrue(!empty.IsEnqueued && !empty.IsActive);
            Assert.IsTrue(empty.countActivate == 1 && empty.countDeactivate == 1);

            // and let's make sure that DEF is the active one now
            Assert.IsTrue(!q.IsEmpty && q.Head == def && q.Head.Head == d);
            Assert.IsTrue(  !abc.IsEnqueued &&   !abc.IsActive);
            Assert.IsTrue(!empty.IsEnqueued && !empty.IsActive);
            Assert.IsTrue(   def.IsEnqueued &&    def.IsActive);
            Assert.IsTrue(def.countActivate == 1 && def.countDeactivate == 0);

            // then if we force-stop DEF, it should clean out of the queue completely
            def.StopScript(true, null);
            Assert.IsTrue(q.IsEmpty && q.Head == null);
            Assert.IsTrue(!def.IsEnqueued && !def.IsActive);
            Assert.IsTrue(def.countActivate == 1 && def.countDeactivate == 1);
        }
示例#48
0
 public void ExecuteStepActions()
 {
     // should execute step actions
     TestAction first = new TestAction();
     TestAction second = new TestAction();
     origin.SetAction( first, "step" );
     origin.SetAction( second, "step" );
     UUnitAssert.False( first.executed );
     origin.Step(context);
     UUnitAssert.True( first.executed, "first step action should have executed");
     UUnitAssert.True( second.executed, "second step action should have executed");
 }
示例#49
0
 public TestEventArgs(TestAction action)
 {
     this.Action = action;
 }
示例#50
0
		protected void ReconnectAndRun(TestAction assertion)
		{
			Reconnect();
			assertion();
		}
示例#51
0
 public TestEventArgs(TestAction action, int testCount)
 {
     this.Action = action;
     this.TestCount = testCount;
 }
示例#52
0
 public TestEventArgs(TestAction action, ResultNode result)
 {
     // TODO: Add Guard for test
     this.Action = action;
     this.Result = result;
 }
示例#53
0
 public TestEventArgs(TestAction action, TestNode test)
 {
     // TODO: Add Guard for test
     this.Action = action;
     this.Test = test;
 }
 internal TestStep(
     TestAction action = TestAction.None,
     int? expectedEntryPointHit = null,
     int? expectedBreakpointHit = null,
     int? expectedStepComplete = null,
     string expectedBreakFile = null,
     ExceptionInfo expectedExceptionRaised = null,
     int? targetBreakpoint = null,
     int? targetBreakpointColumn = null,
     string targetBreakpointFile = null,
     uint? expectedHitCount = null,
     uint? hitCount = null,
     bool? enabled = null,
     BreakOn? breakOn = null,
     string condition = null,
     bool builtin = false,
     bool expectFailure = false,
     bool expectReBind = false,
     Action<NodeDebugger, NodeThread> validation = null,
     int? expectedExitCode = null,
     string expectedBreakFunction = null
 ) {
     _action = action;
     _expectedEntryPointHit = expectedEntryPointHit;
     _expectedBreakpointHit = expectedBreakpointHit;
     _expectedStepComplete = expectedStepComplete;
     _expectedBreakFile = expectedBreakFile;
     _expectedExceptionRaised = expectedExceptionRaised;
     _targetBreakpointFile = targetBreakpointFile;
     _targetBreakpoint = targetBreakpoint;
     _targetBreakpointColumn = targetBreakpointColumn;
     _expectedHitCount = expectedHitCount;
     _hitCount = hitCount;
     _enabled = enabled;
     _breakOn = breakOn;
     _condition = condition;
     _builtin = builtin;
     _expectFailure = expectFailure;
     _expectReBind = expectReBind;
     _validation = validation;
     _expectedExitCode = expectedExitCode;
     _expectedBreakFunction = expectedBreakFunction;
 }
示例#55
0
        public void HandleRequest_ForUnsupportedRequest_DoesNotCallTheAction()
        {
            var route = new Route("tests/([a-z]+).html", typeof(TestAction));
            var action = new TestAction();

            var httpContext = Mocked.HttpContext()
                                    .WithRegisteredAction(action)
                                    .WithHttpMethod("PUT")
                                    .WithUrl("http://localhost/tests/request.html")
                                    .Mock;

            route.HandleRequest(httpContext);

            Assert.Null(action.LastMethod);
        }
示例#56
0
        void Submit()
        {
            _privCenter.btnSave_Click(null,null);

            _prevAction = TestAction.Submitted;
        }
示例#57
0
 public TestParameters(TestAction testAction)
 {
     TestAction = testAction;
 }
示例#58
0
        void Remove()
        {
            var lastContainer = _editBadge.TestGetCommentsControl().ItemContainerGenerator.ContainerFromIndex(
              _editBadge.TestGetCommentsControl().Items.Count - 3);

            if (lastContainer == null)
                return;

            var commentUc = Utils.FindChild<CommentUC>(lastContainer);

            commentUc.btnRemoveComment_Click(null, null);

            _privCenter.btnSave_Click(null, null);

            _prevAction = TestAction.Removed;
        }
示例#59
0
        public void TestStopOnFailure()
        {
            // make some scripts

            var a = new TestAction("a");
            var b = new TestAction("b");
            var c = new TestAction("c");
            var abc = new TestScript("abc", a, b, c);
            var d = new TestAction("d");
            var e = new TestAction("e");
            var f = new TestAction("f");
            var def = new TestScript("def", d, e, f);

            var q = new ScriptQueue();
            q.Enqueue(new List<Script>() { abc, def });

            q.OnUpdate();
            Assert.IsTrue(a.IsEnqueued && a.IsActive && a.IsStarted);

            // if we stop just action a with the failure flag set, it should stop the entire script
            // and advance to the next one
            abc.StopCurrentAction(false, null);

            Assert.IsTrue(!a.IsEnqueued && !a.IsActive);
            Assert.IsTrue(!abc.IsEnqueued && !abc.IsActive);
            Assert.IsTrue(def.IsActive && d.IsActive);

            // similary stopping the script will just remove it
            def.StopScript(false, null);
            Assert.IsTrue(!def.IsActive && !d.IsActive);
        }
        /// <summary>
        /// Creates an initial test instance state object.
        /// </summary>
        /// <param name="testStep">The test step used to execute the test instance.</param>
        /// <param name="testInstanceActions">The test instance actions.</param>
        /// <param name="testState">The test state.</param>
        /// <param name="bindingItem">The data item.</param>
        /// <param name="body">The body of the test instance.</param>
        /// <exception cref="ArgumentNullException">Thrown if <paramref name="testStep"/>,
        /// <paramref name="testInstanceActions"/> or <paramref name="testState"/> or <paramref name="bindingItem"/> is null.</exception>
        /// <exception cref="ArgumentException">Thrown if <paramref name="testState"/> belongs to a
        /// different test from the <paramref name="testStep"/>.</exception>
        internal PatternTestInstanceState(PatternTestStep testStep, 
            PatternTestInstanceActions testInstanceActions,
            PatternTestState testState, IDataItem bindingItem, TestAction body)
        {
            if (testStep == null)
                throw new ArgumentNullException("testStep");
            if (testInstanceActions == null)
                throw new ArgumentNullException("testInstanceActions");
            if (testState == null)
                throw new ArgumentNullException("testState");
            if (testStep.Test != testState.Test)
                throw new ArgumentException("The test state belongs to a different test from the test step.", "testState");
            if (bindingItem == null)
                throw new ArgumentNullException("bindingItem");
            if (body == null)
                throw new ArgumentNullException("body");

            this.testStep = testStep;
            this.testInstanceActions = testInstanceActions;
            this.testState = testState;
            this.bindingItem = bindingItem;
            this.body = body;

            testParameterValues = new Dictionary<PatternTestParameter, object>();
            slotValues = new Dictionary<ISlotInfo, object>();
            data = new UserDataCollection();
            nameBase = testStep.Name;
            nameSuffixes = string.Empty;
        }