Beispiel #1
0
 public void TestMainWindow()
 {
     MainWindow mainWindow = new MainWindow();
     //Test the exception case when clock is at zero
     Assert.AreEqual(TimeSpan.Zero, mainWindow.GetClockTime());
     //Clock is a GUI element so that will be BB tested
 }
Beispiel #2
0
 //on "Race!" button click. create race data, hide this window, pop up new "Main" window
 private void BtnRace_Click(object sender, EventArgs e)
 {
     if (comboBox1.SelectedItem==null || comboBox1.SelectedItem.ToString()=="")
         MessageBox.Show("No Race Selected");
     else {
         var data = new RaceData(this, comboBox1.SelectedItem.ToString(), CommonSQL.SQLiteConnectionString);
         var mainWindow = new MainWindow(data);
         this.Hide();
         mainWindow.Show(); 
     }
 }
 //pre-pop with runner data and get runner ID (this will preform an update)
 public NewUserWindow(RaceData _raceData, MainWindow _parent, string firstName, string lastName, DateTime dob, string bibID, char sex, string team, string org)
     : this(_raceData, _parent)
 {
     textBoxFirstName.Text = firstName;
     textBoxLastName.Text = lastName;
     dateTimePicker1.Value = dob;
     textBoxBibId.Text = bibID;
     textBoxTeam.Text = team;
     textBoxOrginization.Text=org;
     tbGender.Text = sex+"";
     _RunnerID=CommonSQL.GetRunnerID(firstName, lastName, dob);
 }
 //blank new runner window
 public NewUserWindow(RaceData _raceData, MainWindow _parent)
     : this(_raceData)
 {
     this.parent = _parent;
 }