public void Randomizer_BuildRandomNumber() { int n; Assert.That(Randomizer.BuildRandomNumber(5).Length, Is.EqualTo(5)); Assert.IsTrue(int.TryParse(Randomizer.BuildRandomNumber(5), out n)); }
/// <summary> /// Reset username and password /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void button_tabDoctors_resetusernamepassword_Click(object sender, EventArgs e) { ((doctors)doctorsBindingSource.Current).doctors_username = Randomizer.BuildRandomNumberString(8).ToLower(); ((doctors)doctorsBindingSource.Current).doctors_password = Randomizer.BuildRandomNumber(6); ((doctors)doctorsBindingSource.Current).doctors_token = null; ((doctors)doctorsBindingSource.Current).doctors_lastlogin = null; doctorsBindingSource.ResetBindings(true); doctors_lastloginDateTimePicker.Visible = false; doctors_lastloginLabel.Visible = false; }
/// <summary> /// New doctor handler /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void button_tabDoctors_new_Click(object sender, EventArgs e) { if (AddClick(tabElement_tabDoctors)) { ((doctors)doctorsBindingSource.Current).doctors_username = Randomizer.BuildRandomNumberString(8).ToLower(); ((doctors)doctorsBindingSource.Current).doctors_password = Randomizer.BuildRandomNumber(6); ((doctors)doctorsBindingSource.Current).doctors_token = null; ((doctors)doctorsBindingSource.Current).doctors_lastlogin = null; doctorsBindingSource.ResetBindings(true); } }