public void SetCompletionDate_calls_data_service() { // Given const int learningLogItemId = 1; var completedDate = new DateTime(2021, 09, 01); // When learningLogItemsDataService.SetCompletionDate(learningLogItemId, completedDate); // Then A.CallTo(() => learningLogItemsDataService.SetCompletionDate(learningLogItemId, completedDate)) .MustHaveHappenedOnceExactly(); }
public void Set_completed_date_should_update_db() { // Given var addedDate = new DateTime(2021, 11, 1); var newCompletedDate = new DateTime(2020, 7, 29); using (new TransactionScope()) { var itemId = InsertLearningLogItem( GenericDelegateId, addedDate, GenericLearningResourceReferenceId ); // When service.SetCompletionDate(itemId, newCompletedDate); var modifiedItem = service.GetLearningLogItem(itemId); // Then using (new AssertionScope()) { modifiedItem !.CompletedDate.Should().Be(newCompletedDate); } } }
public void SetCompletionDate(int learningLogItemId, DateTime completedDate) { learningLogItemsDataService.SetCompletionDate(learningLogItemId, completedDate); }