Ramifications of virtual methods / properties

Ola - the flow!

I recently used Moq in my development process, and I like what I can achieve.

However, I found myself making my methods (and properties for the most part) virtual, so that I could replace them with a layout in my tests.

Besides the fact that you make all your methods and properties redefinable, what are the real consequences for this course of action?

Thank you for your time,

Dan

+3
source share
2 answers

, . -, JITTER , ( , Mock, ?) , , , . to inline, . , .

, , , , . . , " , ?". , , , , , , .

+7

, . /, , .

, (, ) - , /. " " .

+4

Source: https://habr.com/ru/post/1723532/


All Articles