private void bAddUnitTest_Click(object sender, RoutedEventArgs e) { TestCase tc = new TestCase(); tc.UT = new UnitTest("?unittest", 0, 0, 0, 0, "a"); // Create blank unit test, and pass it to dialog. tc.ShowDialog(); Singleton.GetSingleton().unitTestSuite.unitTests.Add(tc.UT); // Add test case created in dialog. }
private void bEditUnitTest_Click(object sender, RoutedEventArgs e) { if (lvUnitTests.SelectedIndex >= 0) // Only allow editing if we have unit tests. { TestCase tc = new TestCase(); tc.UT = Singleton.GetSingleton().unitTestSuite.unitTests[lvUnitTests.SelectedIndex]; // Pass selected unit test to Edit dialog. tc.ShowDialog(); Singleton.GetSingleton().unitTestSuite.unitTests[0] = tc.UT; // Add test case created in dialog. } }