Beispiel #1
0
        public void Execute_SecondAndThirdColumns_ColumnsHeld()
        {
            var state = new GenerationState();

            state.TestCaseCollection.Scope.Content.Columns.Add("firstColumn");
            state.TestCaseCollection.Scope.Content.Columns.Add("secondColumn");
            state.TestCaseCollection.Scope.Content.Columns.Add("thirdColumn");
            var firstRow = state.TestCaseCollection.Scope.Content.NewRow();

            firstRow[0] = "firstCell";
            firstRow[1] = "secondCell";
            firstRow[2] = "thirdCell";
            state.TestCaseCollection.Scope.Content.Rows.Add(firstRow);
            state.TestCaseCollection.Scope.Variables.Add("firstColumn");
            state.TestCaseCollection.Scope.Variables.Add("secondColumn");
            state.TestCaseCollection.Scope.Variables.Add("thirdColumn");

            var action = new HoldCaseAction(new List <string>()
            {
                "secondColumn", "firstColumn"
            });

            action.Execute(state);
            Assert.That(state.TestCaseCollection.Scope.Content.Columns, Has.Count.EqualTo(2));
            Assert.That(state.TestCaseCollection.Scope.Variables, Has.Member("secondColumn"));
            Assert.That(state.TestCaseCollection.Scope.Variables, Has.Member("firstColumn"));
        }
Beispiel #2
0
        public void Display_SecondAndThirdColumns_CorrectMessage()
        {
            var action = new HoldCaseAction(new List <string>()
            {
                "secondColumn", "firstColumn"
            });

            Assert.That(action.Display, Is.EqualTo("Holding columns 'secondColumn', 'firstColumn'"));
        }
Beispiel #3
0
        public void Execute_SecondColumn_ColumnHeld()
        {
            var state = new GenerationState();

            state.CaseCollection.CurrentScope.Content.Columns.Add("firstColumn");
            state.CaseCollection.CurrentScope.Content.Columns.Add("secondColumn");
            state.CaseCollection.CurrentScope.Content.Columns.Add("thirdColumn");
            var firstRow = state.CaseCollection.CurrentScope.Content.NewRow();

            firstRow[0] = "firstCell";
            firstRow[1] = "secondCell";
            firstRow[2] = "thirdCell";
            state.CaseCollection.CurrentScope.Content.Rows.Add(firstRow);

            var action = new HoldCaseAction("secondColumn");

            action.Execute(state);
            Assert.That(state.CaseCollection.CurrentScope.Content.Columns, Has.Count.EqualTo(1));
            Assert.That(state.CaseCollection.CurrentScope.Variables.ToArray()[0], Is.EqualTo("secondColumn"));
        }
Beispiel #4
0
        public void Display_SecondColumn_CorrectMessage()
        {
            var action = new HoldCaseAction("secondColumn");

            Assert.That(action.Display, Is.EqualTo("Holding column 'secondColumn'"));
        }