mike-ward / VSColorOutput

Color highlighting to Visual Studio's Build and Debug Output Windows
MIT License
430 stars 93 forks source link

Use Mock.VerifyAll() #124

Closed jzabroski closed 3 years ago

jzabroski commented 3 years ago

Hi @mike-ward

I found your project through Nick Craver posting about "stop on first build error" and your plug-in being one of the ways people add this behavior after-market.

I was looking at what you do to enable this behavior, and was just separately wondering, Why not reduce the lines of code in these tests by calling Mock.VerifyAll();? On one hand, I could answer my own question, in that I know the behavior of this helper has changed over time and is less stable than calling VerifyAll() on individual mock instances, but it sure would reduce the lines of code in the tests.

https://github.com/mike-ward/VSColorOutput/blob/9cb2bb75b31db110143be6e30bd41ca0f8e04e59/VSColorOutput.Tests/BuildEventsTests.cs#L198-L208

mike-ward commented 3 years ago

Gosh, it's been years since I looked at that code. Maybe I didn't understand something about mocks at the time or maybe it just grew that way as I wrote more tests.

jzabroski commented 3 years ago

@mike-ward Would you accept a PR to simplify it?

mike-ward commented 3 years ago

Of course.