Exemple #1
0
 /// <summary>
 /// Sends the department to the manager
 /// </summary>
 private void btnCreate_Click(object sender, RoutedEventArgs e)
 {
     createNewDepartment();
     if (result == true)
     {
         try
         {
             result = departmentManager.CreateDepartment(_department);
             if (result == true)
             {
                 this.DialogResult = true;
             }
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message, "Adding Department Failed.");
         }
     }
 }
Exemple #2
0
        public void TestCreatedepartmentValidInput()
        {
            bool expectedResult = true;
            bool actualResult;

            // arrange
            Department testdepartment = new Department()
            {
                DepartmentID = "GoodID",
                Description  = "Good Description",
            };

            // act
            actualResult = departmentManager.CreateDepartment(testdepartment);

            // assert - check if department was added
            Assert.AreEqual(expectedResult, actualResult);
        }