Esempio n. 1
0
        public void Execute_SecondColumn_ColumnsConcatenatedWithNone()
        {
            var state = BuildInitialState();

            state.CaseCollection.CurrentScope.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.CaseCollection.CurrentScope.Content.Columns, Has.Count.EqualTo(3));

            Assert.That(state.CaseCollection.CurrentScope.Content.Rows[0]["secondColumn"], Is.EqualTo("(none)"));
        }
Esempio n. 2
0
        public void Execute_SecondColumn_ColumnsConcatenated()
        {
            var state = BuildInitialState();

            var builder = new ValuableBuilder();
            var values  = builder.Build(ValuableType.Column, new[] { "thirdColumn", "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("secondCell1thirdCell1firstCell1"));
            Assert.That(state.TestCaseCollection.Scope.Content.Rows[1]["secondColumn"], Is.EqualTo("thirdCell2firstCell2"));
            Assert.That(state.TestCaseCollection.Scope.Content.Rows[2]["secondColumn"], Is.EqualTo("(none)"));
        }
Esempio n. 3
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.CaseCollection.CurrentScope.Content.Columns, Has.Count.EqualTo(3));

            Assert.That(state.CaseCollection.CurrentScope.Content.Rows[0]["secondColumn"], Is.EqualTo("secondText1"));
            Assert.That(state.CaseCollection.CurrentScope.Content.Rows[1]["secondColumn"], Is.EqualTo("second2"));
            Assert.That(state.CaseCollection.CurrentScope.Content.Rows[2]["secondColumn"], Is.EqualTo("secondCell3"));
        }
Esempio n. 4
0
        public void Execute_SecondColumnSubstitutueWithValue_ValueSubstitued()
        {
            var state = BuildInitialState();

            state.TestCaseCollection.Scope.Content.Rows[2]["secondColumn"] = "(none)";

            var builder  = new ValuableBuilder();
            var oldValue = builder.Build(ValuableType.Value, "Cell");
            var newValue = builder.Build(ValuableType.Value, "Text");

            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("secondText2"));
            Assert.That(state.TestCaseCollection.Scope.Content.Rows[2]["secondColumn"], Is.EqualTo("(none)"));
        }