When using MOQ I have used the following to transform some input parameter in a mocked service, basically I us a replace transform on a name to generate a value
var mock = new Mock<IFieldLookupProvider>();
mock.Setup(f => f.LookupWorkItemFieldValue(It.IsAny<string>())).Returns((string input) => input.Replace(".", "_"));
Is it possible to do something similar in Typemock? I can't work out how to us an input parameter in the WillReturn block - Is it even possible
var mock = Isolate.Fake.Instance<IFieldLookupProvider>();
Isolate.WhenCalled((string input) => mock.LookupWorkItemFieldValue(input))
.AndArgumentsMatch(input => string.IsNullOrEmpty(input) == false)
.WillReturn(input.Replace(".", "|"));
You get a syntax error in the final block as the variable input is unknown