During my UnitTest, I am creating data that needs to be referenced in future UnitTests. For example:
[TestMethod]
public void CreateOrder()
{
Order order = new Order();
int orderNumber = order.Create();
// return orderNumber;
}
[TestMethod]
public void ProcessOrder()
{
int orderNumber = (int)TestContext.Properties["OrderNumber"];
ProcessOrder(orderNumber);
}
I need to save off 'orderNumber' so that another UnitTest (possibly on another agent) can use this generated order. I have decided that I can use a database, but then I have to operate it like a queue in removing items, and would prefer not to go that route.
Is there any way to 'return' the orderNumber back to the LoadTest and pass that in as a Context parameter in a call to another UnitTest?