public void OrderHistoryWithSubbedAndReplacedItems_ExecutesInReasonableTimeSpan() { // arrange IOrderHistoryLogic testunit = MakeUnitToBeTested(); // act string jsonOrderHistoryFile = GetMockData("OrderHistoryFileWithReplacementItems.json"); Action processOrder = () => testunit.ProcessOrder(jsonOrderHistoryFile); // assert processOrder.ExecutionTime().Should().BeLessOrEqualTo(TimeSpan.FromSeconds(10)); }
public void OrderHistoryWithSubbedAndReplacedItems_IsSentToRepositoryWithValidOrderDate() { // arrange MockDependents mockDependents = new MockDependents(); IOrderHistoryLogic testunit = MakeUnitToBeTested(true, mockDependents); //expect string expectedOrderdate = new DateTime(2018, 07, 19, 16, 34, 51).ToLongDateFormatWithTime(); // act string jsonOrderHistoryFile = GetMockData("OrderHistoryFileWithReplacementItems.json"); testunit.ProcessOrder(jsonOrderHistoryFile); // assert mockDependents.MockOrderHistoryHeaderRepository .Verify(m => m.CreateOrUpdate(It.Is <EF.OrderHistoryHeader>(header => header.OrderDateTime == expectedOrderdate)), Times.Once, "not called with expected order date."); //mockDependents.MockOrderHistoryHeaderRepository.VerifyAll(); }