jozefizso / SystemWrapper

.NET library for easier testing of system APIs.
Microsoft Public License
175 stars 62 forks source link

Added a Kill method to ProcessWrap. #40

Closed AndrewNewcomb closed 7 years ago

AndrewNewcomb commented 7 years ago

Given that the Kill and WaitForExit methods on ProcessWrap just pass through to the underlying process I'm not sure the tests provide much benefit as it seems they're really testing the behaviour of the actual process rather than the ProcessWrap itself.

The tests start a process that runs a cmd file with a known timeout, and then interact with the process before and/or after it completes.

I have included one test which does a Process.Kill on a process that hasn't been started. Maybe the exception is proof enough that the Kill was called on the underlying process, and actually starting a process isn't needed.

I also corrected some namespaces and spacing in comments.

Thanks for a really useful library Jozef.

jozefizso commented 7 years ago

Thanks for the contribution.

I think the exception from not-started process is pretty valid integration test that makes sure the underlying API is called.

AndrewNewcomb commented 7 years ago

I'll commit a new set of files with just the simple test.

AndrewNewcomb commented 7 years ago

Do you need any other changes to this Jozef?