public void DeleteAssignment_Test() { // ARRANGE var assignment = CreateTestAssignment(); var assignmentLogic = new AssignmentLogic(); // ACT assignmentLogic.DeleteAssignment(assignment.Id); assignmentLogic.Dispose(); this.uow.Dispose(); this.uow = new UnitOfWork(); // ASSERT var foundAssignment = uow.Assignments.Get(assignment.Id); Assert.IsNull(foundAssignment); }
private void btn_DeleteAssignment_Click(object sender, RoutedEventArgs e) { if (this.SelectedAssignment != null) { try { var assignmentLogic = new AssignmentLogic(); assignmentLogic.DeleteAssignment(this.SelectedAssignment.Id); assignmentLogic.Dispose(); this.Load(); this.RefreshBindings(this.PagingManager.CurrentPage); } catch (Exception ex) { Logger.LogException(ex); } } }