/// <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."); } } }
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); }