Skip to content

Commit a315945

Browse files
TD-3671 Removing the early implementation on the update method
1 parent 250b981 commit a315945

File tree

7 files changed

+17
-27
lines changed

7 files changed

+17
-27
lines changed

DigitalLearningSolutions.Data/DataServices/ProgressDataService.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public interface IProgressDataService
1515
{
1616
IEnumerable<Progress> GetDelegateProgressForCourse(int delegateId, int customisationId);
1717

18-
void UpdateProgressSupervisorAndCompleteByDate(int progressId, int supervisorAdminId, DateTime? completeByDate, int enrollmentMethodID);
18+
void UpdateProgressSupervisorAndCompleteByDate(int progressId, int supervisorAdminId, DateTime? completeByDate);
1919

2020
int CreateNewDelegateProgress(
2121
int delegateId,
@@ -143,8 +143,7 @@ FROM Progress
143143
public void UpdateProgressSupervisorAndCompleteByDate(
144144
int progressId,
145145
int supervisorAdminId,
146-
DateTime? completeByDate,
147-
int enrollmentMethodID
146+
DateTime? completeByDate
148147
)
149148
{
150149
connection.Execute(
@@ -153,7 +152,7 @@ int enrollmentMethodID
153152
CompleteByDate = @completeByDate,
154153
EnrollmentMethodID = @enrollmentMethodID
155154
WHERE ProgressID = @progressId",
156-
new { progressId, supervisorAdminId, completeByDate, enrollmentMethodID }
155+
new { progressId, supervisorAdminId, completeByDate }
157156
);
158157
}
159158

DigitalLearningSolutions.Web.Tests/Services/GroupServiceTests/GroupsServiceEnrolDelegateTests.cs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,7 @@ public void EnrolDelegateOnGroupCourses_updates_existing_progress_record()
348348
() => progressDataService.UpdateProgressSupervisorAndCompleteByDate(
349349
reusableProgressRecord.ProgressId,
350350
A<int>._,
351-
A<DateTime?>._,
352-
A<int>._
351+
A<DateTime?>._
353352
)
354353
).MustHaveHappened();
355354
}
@@ -385,8 +384,7 @@ public void
385384
() => progressDataService.UpdateProgressSupervisorAndCompleteByDate(
386385
reusableProgressRecord.ProgressId,
387386
reusableProgressRecord.SupervisorAdminId,
388-
A<DateTime?>._,
389-
A<int>._
387+
A<DateTime?>._
390388
)
391389
).MustHaveHappened();
392390
}
@@ -422,8 +420,7 @@ public void EnrolDelegateOnGroupCourses_update_uses_course_supervisor_id_if_cour
422420
() => progressDataService.UpdateProgressSupervisorAndCompleteByDate(
423421
reusableProgressRecord.ProgressId,
424422
supervisorId,
425-
A<DateTime?>._,
426-
A<int>._
423+
A<DateTime?>._
427424
)
428425
).MustHaveHappened();
429426
}
@@ -459,8 +456,7 @@ public void
459456
() => progressDataService.UpdateProgressSupervisorAndCompleteByDate(
460457
reusableProgressRecord.ProgressId,
461458
A<int>._,
462-
null,
463-
A<int>._
459+
null
464460
)
465461
).MustHaveHappened();
466462
}
@@ -498,8 +494,7 @@ public void
498494
() => progressDataService.UpdateProgressSupervisorAndCompleteByDate(
499495
reusableProgressRecord.ProgressId,
500496
A<int>._,
501-
expectedFutureDate,
502-
A<int>._
497+
expectedFutureDate
503498
)
504499
).MustHaveHappened();
505500
}

DigitalLearningSolutions.Web.Tests/Services/GroupServiceTests/GroupsServiceTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,7 @@ private void DelegateMustNotHaveBeenAddedToAGroup()
721721
private void DelegateProgressRecordMustNotHaveBeenUpdated()
722722
{
723723
A.CallTo(
724-
() => progressDataService.UpdateProgressSupervisorAndCompleteByDate(A<int>._, A<int>._, A<DateTime?>._, A<int>._)
724+
() => progressDataService.UpdateProgressSupervisorAndCompleteByDate(A<int>._, A<int>._, A<DateTime?>._)
725725
).MustNotHaveHappened();
726726
}
727727

@@ -764,7 +764,7 @@ private void DatabaseModificationsDoNothing()
764764
A.CallTo(() => groupsDataService.AddDelegateToGroup(A<int>._, A<int>._, A<DateTime>._, A<int>._))
765765
.DoesNothing();
766766
A.CallTo(
767-
() => progressDataService.UpdateProgressSupervisorAndCompleteByDate(A<int>._, A<int>._, A<DateTime?>._, A<int>._)
767+
() => progressDataService.UpdateProgressSupervisorAndCompleteByDate(A<int>._, A<int>._, A<DateTime?>._)
768768
).DoesNothing();
769769
A.CallTo(
770770
() => progressDataService.CreateNewDelegateProgress(

DigitalLearningSolutions.Web.Tests/Services/ProgressServiceTests.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public void UpdateSupervisor_does_not_update_records_if_new_supervisor_matches_c
5858

5959
// Then
6060
A.CallTo(
61-
() => progressDataService.UpdateProgressSupervisorAndCompleteByDate(A<int>._, A<int>._, A<DateTime?>._, A<int>._)
61+
() => progressDataService.UpdateProgressSupervisorAndCompleteByDate(A<int>._, A<int>._, A<DateTime?>._)
6262
).MustNotHaveHappened();
6363
A.CallTo(
6464
() => progressDataService.ClearAspProgressVerificationRequest(A<int>._)
@@ -83,8 +83,7 @@ public void UpdateSupervisor_updates_records_if_new_supervisor_does_not_match_cu
8383
() => progressDataService.UpdateProgressSupervisorAndCompleteByDate(
8484
progressId,
8585
newSupervisorId,
86-
A<DateTime?>._,
87-
A<int>._
86+
A<DateTime?>._
8887
)
8988
).MustHaveHappened();
9089
A.CallTo(
@@ -106,7 +105,7 @@ public void UpdateSupervisor_sets_supervisor_id_to_0_if_new_supervisor_is_null()
106105

107106
// Then
108107
A.CallTo(
109-
() => progressDataService.UpdateProgressSupervisorAndCompleteByDate(progressId, 0, A<DateTime?>._, A<int>._)
108+
() => progressDataService.UpdateProgressSupervisorAndCompleteByDate(progressId, 0, A<DateTime?>._)
110109
).MustHaveHappened();
111110
A.CallTo(
112111
() => progressDataService.ClearAspProgressVerificationRequest(progressId)
@@ -123,7 +122,7 @@ public void UpdateSupervisor_throws_exception_if_no_progress_record_found()
123122
// Then
124123
Assert.Throws<ProgressNotFoundException>(() => progressService.UpdateSupervisor(progressId, null));
125124
A.CallTo(
126-
() => progressDataService.UpdateProgressSupervisorAndCompleteByDate(A<int>._, A<int>._, A<DateTime?>._, A<int>._)
125+
() => progressDataService.UpdateProgressSupervisorAndCompleteByDate(A<int>._, A<int>._, A<DateTime?>._)
127126
).MustNotHaveHappened();
128127
A.CallTo(
129128
() => progressDataService.ClearAspProgressVerificationRequest(A<int>._)

DigitalLearningSolutions.Web/Services/EnrolService.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,7 @@ public void EnrolDelegateOnCourse(int delegateId, int customisationId, int custo
102102
progressDataService.UpdateProgressSupervisorAndCompleteByDate(
103103
progressRecord.ProgressId,
104104
supervisorAdminId ?? 0,
105-
completeByDate,
106-
3
105+
completeByDate
107106
);
108107
}
109108
}

DigitalLearningSolutions.Web/Services/GroupsService.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -743,8 +743,7 @@ IEnumerable<NotificationPreference> delegateNotificationPreferences
743743
progressDataService.UpdateProgressSupervisorAndCompleteByDate(
744744
progressRecord.ProgressId,
745745
updatedSupervisorAdminId,
746-
completeByDate,
747-
3
746+
completeByDate
748747
);
749748
}
750749
}

DigitalLearningSolutions.Web/Services/ProgressService.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,7 @@ public void UpdateSupervisor(int progressId, int? newSupervisorId)
105105
progressDataService.UpdateProgressSupervisorAndCompleteByDate(
106106
progressId,
107107
supervisorId,
108-
courseInfo.CompleteBy,
109-
3
108+
courseInfo.CompleteBy
110109
);
111110

112111
progressDataService.ClearAspProgressVerificationRequest(progressId);

0 commit comments

Comments
 (0)