Unit testing code with a file system dependency

前端 未结 11 785
粉色の甜心
粉色の甜心 2020-11-29 16:50

I am writing a component that, given a ZIP file, needs to:

  1. Unzip the file.
  2. Find a specific dll among the unzipped files.
  3. Load that dll thro
11条回答
  •  悲哀的现实
    2020-11-29 17:05

    For unit test I would suggest that you include the test file in your project(EAR file or equivalent) then use a relative path in the unit tests i.e. "../testdata/testfile".

    As long as your project is correctly exported/imported than your unit test should work.

提交回复
热议问题