Пример #1
0
        public void Filter_Distinct_CorrectNewContent()
        {
            var manager = new TestCaseManager();

            //Setup content;
            manager.Content.Columns.Add(new DataColumn("columnName"));
            manager.Variables.Add("columnName");
            var firstRow = manager.Content.NewRow();

            firstRow[0] = "alpha";
            var secondRow = manager.Content.NewRow();

            secondRow[0] = "beta";
            var duplicatedRow = manager.Content.NewRow();

            duplicatedRow[0] = "alpha";
            manager.Content.Rows.Add(firstRow);
            manager.Content.Rows.Add(secondRow);
            manager.Content.Rows.Add(duplicatedRow);
            manager.Content.AcceptChanges();

            //Setup filter
            manager.FilterDistinct();

            Assert.That(manager.Content.Rows, Has.Count.EqualTo(2));
            Assert.That(manager.Content.Rows[0][0], Is.EqualTo("alpha"));
            Assert.That(manager.Content.Rows[1][0], Is.EqualTo("beta"));
        }
Пример #2
0
        public void Filter_Distinct_EmptyContent()
        {
            var manager = new TestCaseManager();

            //Setup content;
            manager.Content.Columns.Add(new DataColumn("columnName"));
            manager.Variables.Add("columnName");
            manager.Content.AcceptChanges();

            //Setup filter
            manager.FilterDistinct();

            Assert.That(manager.Content.Rows, Has.Count.EqualTo(0));
        }