public void SelectShiftTimesByDepartmentID() { IShiftTimeManager shiftTimeManager = new ShiftTimeManager(_shiftTimeAccessor); List <PetUniverseShiftTime> times; times = shiftTimeManager.RetrieveShiftTimesByDepartment("Sales"); Assert.AreEqual(1, times.Count); }
public void TestShiftTimeManagerRetrieveShiftTimes() { //arrange List <PetUniverseShiftTime> shifTimes; IShiftTimeManager shiftTimeManager = new ShiftTimeManager(_shiftTimeAccessor); //act shifTimes = shiftTimeManager.RetrieveShiftTimes(); //assert Assert.AreEqual(1, shifTimes.Count); }
public void TestShiftTimeManagerDeactivatetShiftTimeTests() { //arrange int shiftTimeID = 100001; bool test; IShiftTimeManager shiftTimeManager = new ShiftTimeManager(_shiftTimeAccessor); bool expectedResult = true; //act test = shiftTimeManager.DeactivateShiftTime(shiftTimeID); //assert Assert.AreEqual(test, expectedResult); }
public void TestShiftTimeManagerInsertShiftTimeTests() { //arrange PetUniverseShiftTime shiftTime = new PetUniverseShiftTime(); shiftTime.DepartmentID = "Shipping/Receiving"; shiftTime.StartTime = "14:00:00"; shiftTime.EndTime = "22:00:00"; bool test; IShiftTimeManager shiftTimeManager = new ShiftTimeManager(_shiftTimeAccessor); //act test = shiftTimeManager.AddShiftTime(shiftTime); //assert Assert.IsTrue(test); }
public void TestSelectShiftTimesByID() { IShiftTimeManager shiftTimeManager = new ShiftTimeManager(_shiftTimeAccessor); PetUniverseShiftTime time; PetUniverseShiftTime target = new PetUniverseShiftTime() { ShiftTimeID = 100001, DepartmentID = "Sales", StartTime = "08:45:00", EndTime = "5:45:00" }; time = shiftTimeManager.RetrieveShiftTimeByID(100001); Assert.AreEqual(target.ShiftTimeID, time.ShiftTimeID); }
/// <summary> /// Creator: Jordan Lindo /// Created: 2/15/2020 /// Approver: Alex Diers /// /// This button click listener sends the data for creating a new department record to the logic layer /// </summary> /// <remarks> /// Updater: NA /// Updated: NA /// Update: NA /// /// </remarks> /// <param name="sender"></param> /// <param name="e"></param> private void btnAddDepartmentSave_Click(object sender, RoutedEventArgs e) { string departmentID = txtAddDepartmentDepartmentName.Text; string description = txtAddDepartmentDescription.Text; if (ValidateERole.checkDepartmentID(departmentID) && ValidateERole.checkDescription(description)) { try { if (_departmentManager.AddDepartment(departmentID, description)) { ShiftTimeManager _shiftTimeManger = new ShiftTimeManager(); try { foreach (PetUniverseShiftTime shiftTime in DEFAULT_SHIFTTIMES) { shiftTime.DepartmentID = departmentID; _shiftTimeManger.AddShiftTime(shiftTime); } } catch (Exception ex) { WPFErrorHandler.ErrorMessage("failed to save departments Default Shift Times. " + ex.Message); } WPFErrorHandler.SuccessMessage("Department added, with default shift times"); canAddDepartment.Visibility = Visibility.Hidden; canDepartmentList.Visibility = Visibility.Visible; showDGDepartments(); } else { WPFErrorHandler.ErrorMessage("Department not added."); } } catch (Exception ex) { WPFErrorHandler.ErrorMessage("Department failed to save. " + ex.Message); } }
public void TestShiftTimeManagerEditShiftTimeTests() { //arrange PetUniverseShiftTime oldShiftTime = new PetUniverseShiftTime(); oldShiftTime.DepartmentID = "Shipping/Receiving"; oldShiftTime.StartTime = "14:00:00"; oldShiftTime.EndTime = "22:00:00"; PetUniverseShiftTime newShiftTime = new PetUniverseShiftTime(); newShiftTime.DepartmentID = "Shipping/Receiving"; newShiftTime.StartTime = "08:00:00"; newShiftTime.EndTime = "16:00:00"; bool test; IShiftTimeManager shiftTimeManager = new ShiftTimeManager(_shiftTimeAccessor); //act test = shiftTimeManager.EditShiftTime(oldShiftTime, newShiftTime); //assert Assert.IsTrue(test); }