Пример #1
0
        public void Execute_SecondColumn_ColumnHeld()
        {
            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("secondColumn");
            action.Execute(state);
            Assert.That(state.TestCaseCollection.Scope.Content.Columns, Has.Count.EqualTo(1));
            Assert.That(state.TestCaseCollection.Scope.Variables[0], Is.EqualTo("secondColumn"));
        }
Пример #2
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"));
        }
Пример #3
0
 public void Display_SecondColumn_CorrectMessage()
 {
     var action = new HoldCaseAction("secondColumn");
     Assert.That(action.Display, Is.EqualTo("Holding column 'secondColumn'"));
 }
Пример #4
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'"));
 }