public void WebGetRequestExecuteWhereErrorExpectErrorAdded()
{
//------------Setup for test--------------------------
var mock = new Mock<IWebRequestInvoker>();
const string Message = "This is a forced exception";
mock.Setup(invoker => invoker.ExecuteRequest(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<List<Tuple<string, string>>>(), It.IsAny<int>())).Throws(new InvalidDataException(Message));
var activity = GetWebGetRequestActivity(mock);
activity.Method = "GET";
activity.Url = "BodyValue";
TestStartNode = new FlowStep
{
Action = activity
};
TestData = "<root><testVar /></root>";
//------------Execute Test---------------------------
ExecuteProcess();
//------------Assert Results-------------------------
mock.Verify(sender => sender.ExecuteRequest(activity.Method, activity.Url, It.IsAny<List<Tuple<string, string>>>(), It.IsAny<int>()), Times.Once());
string errorString = DataObject.Environment.FetchErrors();
StringAssert.Contains(errorString, Message);
}