Example #1
0
        public void Initializes(string header, string[] col1, string[] col2)
        {
            using (var app = Application.Launch(Info.ExeFileName, WindowName))
            {
                var window = app.MainWindow;
                CollectionAssert.AreEqual(new[] { "1", "2", "3" }, window.FindGroupBox("Source").FindListBox().Items.Select(x => x.FindTextBlock().Text));

                var dataGridAndEVents = new DataGridAndEvents(window.FindGroupBox(header));
                CollectionAssert.AreEqual(col1, dataGridAndEVents.DataGrid.ColumnValues(0));
                CollectionAssert.AreEqual(col2, dataGridAndEVents.DataGrid.ColumnValues(1));
                CollectionAssert.IsEmpty(dataGridAndEVents.Events.Items);
            }
        }
Example #2
0
        public void AddOneOnOtherThread(string header, string col1, string col2)
        {
            using (var app = Application.Launch(Info.ExeFileName, WindowName))
            {
                var window = app.MainWindow;
                window.FindButton("Clear").Invoke();
                window.FindButton("Add to source on thread").Invoke();
                CollectionAssert.AreEqual(new[] { "1" }, window.FindGroupBox("Source").FindListBox().Items.Select(x => x.FindTextBlock().Text));

                var dataGridAndEVents = new DataGridAndEvents(window.FindGroupBox(header));
                CollectionAssert.AreEqual(new[] { col1 }, dataGridAndEVents.DataGrid.ColumnValues(0));
                CollectionAssert.AreEqual(new[] { col2 }, dataGridAndEVents.DataGrid.ColumnValues(1));
                CollectionAssert.AreEqual(new[] { "Reset", "Add" }, dataGridAndEVents.Events.Items.Select(x => x.FindTextBlock().Text));
            }
        }