Hi Doron,
Nope, no version upgrade we're still using 5.1.2 x64.
It was the beginning of this week. The only thing I've done is to change the way a Unity Container was being populated. It's moved from being from a config file to mocking.
I've also noted that all tests in this test class now throw this error when debugging, but pass when run :(
An example test method (with sanitised types):
[TestInitialize]
public void InitialiseWorkflowRuntime()
{
m_WorkflowRuntime = new WorkflowRuntime();
// By using a Manual Scheduler, we can make the Activity execute when we want
m_Scheduler = new ManualWorkflowSchedulerService();
m_WorkflowRuntime.AddService(m_Scheduler);
m_WorkflowRuntime.WorkflowCompleted += WorkflowCompleted;
m_WorkflowRuntime.WorkflowTerminated += WorkflowTerminated;
m_Exception = null;
m_Result = null;
}
[TestCleanup]
public void CleanupWorkflowRuntime()
{
m_WorkflowRuntime.WorkflowCompleted -= WorkflowCompleted;
m_WorkflowRuntime.WorkflowTerminated -= WorkflowTerminated;
m_WorkflowRuntime.Dispose();
}
[TestMethod]
[VerifyMocks]
public void TestMethod()
{
UnityContainer populatedContainer = GetPopulatedContainer();
using (RecordExpectations recorder = new RecordExpectations())
{
UnityContainer unity = new UnityContainer();
recorder.Return(populatedContainer);
populatedContainer.LoadConfigurationFiles("Container");
}
Dictionary<string> parameters = new Dictionary<string> { { PropertyName, m_Value } };
WorkflowInstance instance = m_WorkflowRuntime.CreateWorkflow(typeof(Activity), parameters);
instance.Start();
m_Scheduler.RunWorkflow(instance.InstanceId);
Assert.IsNull(m_Exception);
Assert.IsNotNull(m_Result);
Message outputMessage = m_Result[NewMessagePropertyName] as Message;
Assert.IsNotNull(outputMessage);
outputMessage.MessageText = TestMessage;
Assert.AreEqual(expectedResult, builtMessage);
}
The exception can occur on any of the non mocked object during the TestInitialise or Arrange or during setting the expectations.
Cheers,
John