public void confirmGettingDeliveryAllCorrect() { Delivery delivery = EntitySetuper.SetupDeliveryAndBill(_context, false, true); bool result = _deliveryService.ConfirmGettingDelivery(delivery.Addressee.UserName, delivery.DeliveryId); Assert.IsTrue(result); Assert.IsTrue(delivery.IsPackageReceived); }
public void confirmGettingDeliveryAllCorrect() { Delivery delivery = ServicesTestConstant.getDelivery(); _deliveryRepository.Setup(s => s.FindByIdAndAddressee_IdAndIsPackageReceivedFalse( ServicesTestConstant.getUserId(), ServicesTestConstant.getDeliveryId())) .Returns(delivery); bool result = _deliveryService.ConfirmGettingDelivery(ServicesTestConstant.getUserId(), ServicesTestConstant.getDeliveryId()); _deliveryRepository.Verify( place => place.FindByIdAndAddressee_IdAndIsPackageReceivedFalse (It.IsAny <string>(), It.IsAny <long>()), Times.Once()); _deliveryRepository.Verify( place => place.Save(), Times.Once()); Assert.IsTrue(result); Assert.IsTrue(delivery.IsPackageReceived); }