コード例 #1
0
        public void Execute_SecondColumnSubstitutueWithColumn_ValueSubstitued()
        {
            var state = BuildInitialState();

            var builder = new ValuableBuilder();
            var oldValue = builder.Build(ValuableType.Column, "firstColumn");
            var newValue = builder.Build(ValuableType.Column, "thirdColumn");

            var action = new SubstituteCaseAction("secondColumn", oldValue, newValue);
            action.Execute(state);
            Assert.That(state.TestCaseCollection.Scope.Content.Columns, Has.Count.EqualTo(3));

            Assert.That(state.TestCaseCollection.Scope.Content.Rows[0]["secondColumn"], Is.EqualTo("secondText1"));
            Assert.That(state.TestCaseCollection.Scope.Content.Rows[1]["secondColumn"], Is.EqualTo("second2"));
            Assert.That(state.TestCaseCollection.Scope.Content.Rows[2]["secondColumn"], Is.EqualTo("secondCell3"));
        }
コード例 #2
0
        public void Execute_SecondColumn_ColumnsConcatenatedWithNone()
        {
            var state = BuildInitialState();
            state.TestCaseCollection.Scope.Content.Rows[0]["firstColumn"] = "(none)";

            var builder = new ValuableBuilder();
            var values = builder.Build(ValuableType.Column, new[] { "firstColumn" });

            var action = new ConcatenateCaseAction("secondColumn", values);
            action.Execute(state);
            Assert.That(state.TestCaseCollection.Scope.Content.Columns, Has.Count.EqualTo(3));

            Assert.That(state.TestCaseCollection.Scope.Content.Rows[0]["secondColumn"], Is.EqualTo("(none)"));
        }