I have just added an out bool parameter to a method I've written in order to get a warning in to my UI. I've used an out rather than getting the method itself to return false/true as that would imply the DoSomething failed/succeeded. My thinking was that the warnUser would indicate what the warning actually was without having to look at the implementation of the method.
Original Code
public void DoSomething(int id, string input);
New Code
public void DoSomething(int id, string input, out bool warnUser);
I'm using Moq to test this code, but it doesn't support out/ref parameters because they're not supported by Lambda expressions
Test Code
mockService.Verify(It.IsAny<int>(), It.IsAny<string>(), It.IsAny<bool>());
So, is using out parameters bad practise and if so what do I do instead?