Is it OK to have multiple assertions in a unit test when testing complex behavior?

后端 未结 3 1750
栀梦
栀梦 2021-01-17 04:06

Here is my specific scenario.

I have a class QueryQueue that wraps the QueryTask class within the ArcGIS API for Flex. This enables me to e

3条回答
  •  别那么骄傲
    2021-01-17 04:39

    I am not familiar with flex, but I think I have good experience in unit testing, so you have to know that unit test is a philosophy, so for the first answer, yes you can make a multiple assert but if you test the same behavior, the main point always in unit testing is to be very maintainable and simple code, otherwise the unit test will need unit test to test it! So my advice to you is, if you are new in unit testing, don't use multiple assert, but if you have good experience with unit testing, you will know when you will need to use them

提交回复
热议问题