TFS单元测试在构建机器上传递但在TFS-Build上失败

时间:2015-11-30 08:13:33

标签: c# unit-testing tfsbuild tfs2013

我有一个单元测试,当它由TFS-build运行时失败,而当它在构建机器上运行时通过它(通过Visual Studio) [它也传递我的本地机器]

是否有人对此问题有任何信息或提示?

测试确实使用来自文件的数据。 另一个测试(不使用PDFTron)通过! (我的意思是问题不在于数据源的文件中) 这是代码:

// The first part of the test method is converting a Doc file to a Pdf
// I do it by PDFTron (PDFNet.dll)

public TestContext TestContext { get; set; }

[TestMethod]
[DataSource(@"System.Data.Odbc", @"Driver={Microsoft Excel Driver (*.xls)};DriverId=790;Dbq=C:\FilesRepo.xls;DefaultDir=.", "Doc$", DataAccessMethod.Sequential)]
public void ConvertDocToPdf()
{
    string path = TestContext.FilePath;
    string pdfPath = path + ".pdf";

    using (PDFDoc pdfdoc = new PDFDoc())
    {
        pdftron.PDF.Convert.ToPdf(pdfdoc, path); // <-- Here I get the exception:
        // Exception: 
        //  Message: Unable to open the file
        //  Conditional expression: m_stream != NULL
        //  Filename   : StdFile.cpp
        //  Function   : trn::Filters::StdFile::InitW
        //  Linenumber : 210
        pdfdoc.Save(pdfPath, SDFDoc.SaveOptions.e_linearized);
    }
    // More code
}

0 个答案:

没有答案
相关问题