TestContext.AddResultFile

Hi,

What is the intent of TextContext.AddResultFile() do The help file just lists out the method at this point. I thought it would let me override the result file location, but that wasn't the case.

Is this a result file that I can add and then populate with additional log information by calling TestContext.WriteLine

Thanks.


Answer this question

TestContext.AddResultFile

  • Benlbit

    that's nice, but I can't find anywhere within VS2005 a list with all such included files ! how can I access them

  • George Mantzouranis

    This allows you to add a file that wasn't part of the previously specified (eg auto detected, deployment files etc) to be present in the deployment result directory.

    TestContext.WriteLine() writes trace messages that will show up in the detailed results of a Unit Test.

    How are you wanting to change the result file location - whats your scenario

  • digidigi77

    Thanks. That answers my question. I didn't know what it was for and thought it was intended to change the location of the result file instead of adding an additional file to the output directory. I know I can change the output directory in the test configuration. It all makes sense now.
  • vbpixelgog

    Lets say my test generates 3 files. I add them to the TestContext and the test fails for some reason.

    Now I want to see the contents of those 3 files, but there is no list, and no link to these files anywhere within the test-details page, nor anywhere else in the VS-UI.

    It would have been nice if the test-details page would show these files for easy access to them. What point is there in adding them to the test, if I can't access them in any manner (except searching for them in the filesystem and having to match test-run-names).



  • japm

    Gerhardo: If that answered your question could you click "Mark as correct Answer" next to the reply button on the post to give him credit for the answer You should see it if you sign in.

  • Sunil

    You can use this method to copy a file as part of result. I.e. if your test create some additional files and if you want keep it as part of result, you use this method. The file is copied to result In directory.

    Thanks,
    Bata

  • Regis M

    You mean which files are already set, or a list that would be commonly included -- I don't think we have a list right now. The list of files varies for many reasons.

    Whats the specific issue you are having



  • TestContext.AddResultFile