How to do integration testing in .NET with real files?

后端 未结 5 1060
孤独总比滥情好
孤独总比滥情好 2020-12-23 09:17

I have some classes that implements some logic related to file system and files. For example, I am performing following tasks as part of this logic:

  • checking i
5条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-23 09:54

    I would build framework logic and test concurrency issues and file system exceptions to ensure a well defined test environment.

    Try to list all the boundaries of the problem domain. If there are too many, then consider the possibility that your problem is too broadly defined and needs to be broken down. What is the full set of necessary and sufficient conditions required to make your system pass all tests? Then look at every condition and treat it as an individual attack point. And list all the ways you can think of, of breaching that. Try to prove to yourself that you have found them all. Then write a test for each.

    I would go through the above process first for the environment, build and test that first to a satisfactory standard and then for the more detailed logic within the workflow. Some iteration may be required if dependencies between the environment and the detailed logic occur to you during testing.

提交回复
热议问题