I have the following unit test for a WF code activity called MyCodeActivity:
[ExpectedException(typeof(ArgumentException))]
[TestMethod]
public void ShouldRequireParam()
{
//arrange
var invoker = new WorkflowInvoker(new MyCodeActivity()
{
MyInt = 2,
MyComplexObject = _complexObject
});
//act
invoker.Invoke();
//assert
Assert.Fail("Expected ArgumentException");
}
When I run the test I get the following exception
'Literal< MyComplexObject>': Literal only supports value types and the immutable type System.String. The type MyComplexObject cannot be used as a literal.