public void RemoveLearningLogItem_correctly_sets_removed_date_and_removed_by_id() { // Given var addedDate = new DateTime(2021, 11, 1); var removedDate = new DateTime(2021, 12, 6); using (new TransactionScope()) { var itemId = InsertLearningLogItem( GenericDelegateId, addedDate, GenericLearningResourceReferenceId ); // When service.RemoveLearningLogItem(itemId, GenericDelegateId, removedDate); var result = service.GetLearningLogItem(itemId); // Then using (new AssertionScope()) { result.Should().NotBeNull(); result !.ArchivedDate.Should().Be(removedDate); result.ArchivedById.Should().Be(GenericDelegateId); } } }
public void RemoveActionPlanResource_removes_item() { // Given var testDate = new DateTime(2021, 12, 6); A.CallTo(() => clockService.UtcNow).Returns(testDate); const int delegateId = 2; const int actionPlanId = 3; A.CallTo(() => learningLogItemsDataService.RemoveLearningLogItem(A <int> ._, A <int> ._, A <DateTime> ._)) .DoesNothing(); // When actionPlanService.RemoveActionPlanResource(actionPlanId, delegateId); // Then A.CallTo(() => learningLogItemsDataService.RemoveLearningLogItem(actionPlanId, delegateId, testDate)) .MustHaveHappenedOnceExactly(); }
public void RemoveActionPlanResource(int learningLogItemId, int delegateId) { var removalDate = clockService.UtcNow; learningLogItemsDataService.RemoveLearningLogItem(learningLogItemId, delegateId, removalDate); }