vendredi 10 août 2018

Assert exception raised due to previous test-case failure

I can not think of a better heading.
In the following code, if rollBackLogger is Nil, the first test case would get failed but all other test cases would raise an exception. Is there a way available to avoid this, other than using an if check. I believe this would be a very common situation for unit testing there would be some API in assert or some other way around to avoid this.

assert.NotNil(rollbackLogger)
assert.Equal("Action", rollBackLogger[0].Action)
assert.Equal("random path", rollBackLogger[0].FilePath)

Aucun commentaire:

Enregistrer un commentaire