Hi, I have a method with the following signature:
public void GeneratePaymentAdvise(IList<int> paymentIds)
and this is called in another way:
public void UpdatePaymentStatus(IList<int> paymentIds, IPaymentLogic paymentLogic) { ... paymentLogic.GeneratePaymentStatus(paymentIds); ... }
So, in unit test, I want to make sure that it is called. Using moq:
var mockPaymentLogic = new Mock<PaymentLogic>(); UpdatePaymentStatus(new List<int> { 2, 3 }, mockPaymentLogic.Object); mockPaymentLogic.Verify(x => x.GeneratePaymentStatus(It.IsAny<IList<int>>());
So this will work fine and checks that GeneratePaymentStatus is being called, but only the one that was called with any old list of ints.
Is there a way to rewrite this so that it tests that GeneratePaymentStatus has been called with an int list containing 2 and 3?
source share