|
Hello,
I am trying to test an activity with variable but have not been able to. Please point me to any sample you may have on this.
My test code:
[TestMethod()] public void DataProcessTest() { MyActivity activity = new MyActivity(); var host = WorkflowInvokerTest.Create(activity); var input = InputDictionary.Create("value1", 1); try { // Act host.TestActivity(input); // Assert // Note: The host automatically captures the out arguments host.AssertOutArgument.AreEqual("MyVariable", false); } finally { // Note: The host automatically captures tracking host.Tracking.Trace(); } }
My activity executes fine until it gets to this line of code:
PropertyDescriptor myProperty = context.DataContext.GetProperties()["MyVariable"];
myProperty.SetValue(context.DataContext, true);
I got an Object reference not set to an instance of an object. It is saying myProperty is null. How do I include this property as an argument to the workflow host?
THank you in advance for your help.
|