Error CS0854 when you’re using Moq with optional parameters

Problem Optional parameters aren’t optional when you’re using Moq. When you’re setting up or verifying a method call on a mock object, and the method has an optional parameter that you didn’t specify a value for, you’ll get the following compiler error: Error CS0854 – An expression tree may not contain a call or invocation … Read more