コード例 #1
0
 private void ArrangeTestAccordingToItem(Item expectedItem)
 {
     _timeManager.GetCurrentTime().Returns(expectedItem.CreationTime);
     _guidGenerator.GenerateId().Returns(expectedItem.Id);
     _repository.AddItemAsync(ArgWrapper.IsItem(expectedItem))
     .Returns(Task.FromResult(expectedItem));
 }
コード例 #2
0
 private void ArrangeTestAccordingToItem(Item expectedItem, Item itemForUpdate)
 {
     _timeManager.GetCurrentTime().Returns(expectedItem.LastUpdateTime);
     _getItemService.GetItemAsync(itemForUpdate.Id).Returns(Task.FromResult(new RetrievedItem <Item>(itemForUpdate)));
     _repository
     .UpdateItemAsync(ArgWrapper.IsItem(expectedItem))
     .Returns(Task.FromResult(expectedItem));
 }