public void Execute_ContentWithTwoGroupedRowsForTwoColumns_ContentReduced() { var state = new GenerationState(); state.TestCaseCollection.Scope.Content.Columns.Add("firstColumn"); state.TestCaseCollection.Scope.Content.Columns.Add("secondColumn", typeof(List<string>)); state.TestCaseCollection.Scope.Content.Columns.Add("thirdColumn", typeof(List<string>)); state.TestCaseCollection.Scope.Variables.Add("firstColumn"); state.TestCaseCollection.Scope.Variables.Add("secondColumn"); state.TestCaseCollection.Scope.Variables.Add("thirdColumn"); var firstRow = state.TestCaseCollection.Scope.Content.NewRow(); firstRow[0] = "firstCell1"; firstRow[1] = new List<string>() { "secondCell1", "secondCell1", "secondCell2" }; firstRow[2] = new List<string>() { "thirdCell1", "thirdCell1", "thirdCell1" }; state.TestCaseCollection.Scope.Content.Rows.Add(firstRow); var action = new ReduceCaseAction(new[] { "thirdColumn", "secondColumn" }); action.Execute(state); Assert.That(state.TestCaseCollection.Scope.Content.Rows, Has.Count.EqualTo(1)); Assert.That(state.TestCaseCollection.Scope.Content.Rows[0]["thirdColumn"], Is.TypeOf<List<string>>()); Assert.That(state.TestCaseCollection.Scope.Content.Rows[0]["thirdColumn"], Has.Member("thirdCell1")); Assert.That(state.TestCaseCollection.Scope.Content.Rows[0]["thirdColumn"], Has.Count.EqualTo(1)); Assert.That(state.TestCaseCollection.Scope.Content.Rows[0]["secondColumn"], Is.TypeOf<List<string>>()); Assert.That(state.TestCaseCollection.Scope.Content.Rows[0]["secondColumn"], Has.Member("secondCell1")); Assert.That(state.TestCaseCollection.Scope.Content.Rows[0]["secondColumn"], Has.Member("secondCell2")); Assert.That(state.TestCaseCollection.Scope.Content.Rows[0]["secondColumn"], Has.Count.EqualTo(2)); }
public void Display_LikeOneValue_CorrectString() { var action = new ReduceCaseAction(new[] { "foo", "bar" }); Assert.That(action.Display, Is.EqualTo("Reducing the length of groups for columns 'foo', 'bar'")); }