简体   繁体   中英

Should I test the correct action is subscribed too

I am working on a C# wpf project that uses prism. I am trying to use TDD, still new to trying to execute it properly. The issue I am having is in the constructor of a class, I subscribe to an event with a function from the class.

I have found how to verify that an event gets subscribed too, but how and more importantly should I test that the correct function is subscribed to the event? Is this going beyond unit testing and more integration testing?

I'd test that the event triggers the correct response.

That way you test the expected behaviour of your class and not, at least partially, the correct function of the used library (that brings its own set of tests).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM