本文整理汇总了C#中IServices.GetInterviewFile方法的典型用法代码示例。如果您正苦于以下问题:C# IServices.GetInterviewFile方法的具体用法?C# IServices.GetInterviewFile怎么用?C# IServices.GetInterviewFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IServices
的用法示例。
在下文中一共展示了IServices.GetInterviewFile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetInterviewFile
private void GetInterviewFile(IServices svc)
{
Template template = null;
string fileName = null;
string fileType = null;
for (int i = 0; i < 7; i++)
{
switch (i)
{
case 1:
template = Util.OpenTemplate("d1f7cade-cb74-4457-a9a0-27d94f5c2d5b");
break;
case 2:
fileName = "Demo Employment Agreement.docx";
break;
case 3:
fileName = "";
fileType = "js";
break;
case 4:
fileName = "Demo Employment Agreement.docx";
fileType = "js";
break;
case 5:
fileType = "dll";
break;
case 6:
fileName = "Demo Employment Agreement.docx.js";
fileType = "img";
break;
}
try
{
using (Stream definitionFile = svc.GetInterviewFile(i == 0 ? null : template, fileName, fileType))
{
if (template == null || string.IsNullOrEmpty(fileName) || string.IsNullOrEmpty(fileType))
Assert.Fail(); // Should have hit an exception instead of reaching this.
Assert.IsTrue(definitionFile.Length > 0);
}
}
catch (ArgumentNullException ex)
{
if (template == null)
Assert.IsTrue(ex.Message.Contains("template"));
else if (string.IsNullOrEmpty(fileName))
Assert.IsTrue(ex.Message.Contains("fileName"));
else if (string.IsNullOrEmpty(fileType))
Assert.IsTrue(ex.Message.Contains("fileType"));
else
Assert.Fail(); // After the first three times, we don't pass any invalid parameters so this should not happen.
}
}
}