本文整理汇总了C#中IResponse.Initialize方法的典型用法代码示例。如果您正苦于以下问题:C# IResponse.Initialize方法的具体用法?C# IResponse.Initialize怎么用?C# IResponse.Initialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IResponse
的用法示例。
在下文中一共展示了IResponse.Initialize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ResponseTest
/// <summary>
/// Test the response
/// </summary>
/// <param name="response">The response.</param>
/// <param name="expectedType">The expected type.</param>
/// <param name="lineCount">The line count.</param>
/// <param name="expectedDisplay">The expected display.</param>
/// <param name="lines">The response lines.</param>
/// <param name="fileContents">The file contents.</param>
private void ResponseTest(IResponse response, ResponseType expectedType, int lineCount, string expectedDisplay, IList<string> lines, string fileContents)
{
Assert.AreEqual(lineCount, response.LineCount);
Assert.AreEqual(expectedType, response.Type);
response.Initialize(lines);
Assert.IsFalse(response.Processed);
response.Process();
Assert.IsTrue(response.Processed);
if (response is IFileResponse)
((IFileResponse)response).Contents = fileContents.Encode();
string display = response.Display();
Console.WriteLine(display);
Assert.AreEqual(expectedDisplay, display);
XElement el = response.GetXElement();
bool result = TestHelper.ValidateResponseXML(el);
Assert.IsTrue(result);
Console.WriteLine(el.ToString());
Console.WriteLine("Lines:");
foreach (string s in response.Lines)
{
Console.WriteLine(s);
}
}