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?
Queuemember variable in the class these methods are defined in. That way,CreateOrder()can add to the queue andProcessOrder()can pull from it. Otherwise, try read this for details about Load Tests in Visual Studio.The LoadTest Plugin? Is there a specific plugin for this that you are using?