I am trying to decide whether to introduce mocks in my isolated Domain Model tests. I have a class method similar to this:
public Offer AssignOffer(OfferType offerType, IOfferValueCalculator valueCalculator) { DateTime dateExpiring = offerType.CalculateExpirationDate(); int value = valueCalculator.CalculateValue(this, offerType); var offer = new Offer(this, offerType, dateExpiring, value); _assignedOffers.Add(offer); NumberOfActiveOffers++; return offer; }
which I took from here: https://github.com/jbogard/presentations/blob/master/WickedDomainModels/After/Model/Member.cs
I have now read this article: http://enterprisecraftsmanship.com/2016/06/15/pragmatic-unit-testing/ and this article: http://www.taimila.com/blog/ddd-and-testing-strategy/. They both seem to suggest that I should not mock OfferType (as it is a Value Object). However my question is: should I be mocking IOfferValueCalculator (a Domain Service)? IOfferValueCalculator does not sit in the innermost layer of the Onion, however it does sit in the Domain Model (second most inner layer of the Onion).
The reason I ask is because all these articles specifically reference Entities and Value Objects (advising against mocking them), however they do not reference Domain Services.