public void JobDetailsUpdated_Correctly()
        {
            string Name        = "John Knight";
            int    Shifts      = 3;
            String jobSelected = ls[new Random().Next(0, 5)];

            one.AssignJob(jobSelected, Shifts, Name);
            Assert.AreNotEqual(shifts, Shifts);//Should not be equal until after SelectCurrent_JobAndShiftsQuery() runs.
            Assert.AreNotEqual(current_job, jobSelected);
            SelectCurrent_JobAndShiftsQuery(Name);
            Assert.AreEqual(jobSelected, current_job);
            Assert.AreEqual(Shifts, shifts);
        }
示例#2
0
        private void assignJobButton_Click(object sender, EventArgs e)
        {
            if (jobsComboBox.SelectedItem != null && NoOfShiftsNumericUpDown.Value != 0 && AvlbleEmplsComboBox.SelectedItem != null)//Job will only be assigned if employee and job selected. No. of shifts must be above 0.
            {
                jobsAssignedTextBox.Text = AvlbleEmplsComboBox.SelectedItem.ToString().ToUpper() + " to " + jobsComboBox.SelectedItem + " for " + NoOfShiftsNumericUpDown.Value + " Shifts";

                string EmployeeInfo = AvlbleEmplsComboBox.SelectedItem.ToString();
                string EmployeeName = EmployeeInfo.Substring(EmployeeInfo.LastIndexOf(',') + 1);
                employer.AssignJob(jobsComboBox.SelectedItem.ToString(), (int)NoOfShiftsNumericUpDown.Value, EmployeeName);
                AvlbleEmplsComboBox.ResetText();
                startShiftButton.Enabled      = true;
                NoOfShiftsNumericUpDown.Value = 0;
                jobsComboBox.ResetText();
            }
            else
            {
                MessageBox.Show("Please complete all fields!");
            }
        }