Using JustMock, can I arrange a layout to return something based on an input parameter?
For example, let's say that the method accepts int , I want to return this value + 1
I want the output to always be laughed at as input + 1, but I don't know the input during development.
My real use for this is with an object parameter, and I need to make fun of it to always return a new object with some of the same properties ... but I don't know how to refer to the parameters in the .Returns() section.
EDIT: More details:
Three types:
IMoneyConverter
Money
Currency
An object
A Money has two properties: decimal valueAmount and Currency valueCurrency
IMoneyConverter discloses:
.Convert(Money valueFrom, Currency currencyTo, DateTime asOfDate)
This method returns the converted Money object to the new Currency (currencyTo) on the specified date.
My intention is to mock IMoneyConverter so that its .Convert method returns a new Money object that has the size of the Money parameter (valueFrom) and the Currency parameter of currencyTo.
source share