machine / machine.specifications

Machine.Specifications is a Context/Specification framework for .NET that removes language noise and simplifies tests.
MIT License
885 stars 178 forks source link

Fixes #224 - ArgumentOutOfRangeException when running tests #338

Closed dannyvincent closed 7 years ago

dannyvincent commented 7 years ago

Fixes this error that occurs during test runs: (as described in #224)

ERROR System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: chunkLength
   at System.Text.StringBuilder.ToString()

You may notice that I added 3 commits: a failing test, with necessary scope changes to the internal class OutputInterceptor; the change to make the test pass; then I reverted the first commit.

Adds type SafeStringWriter which operates over an instance of StringBuilder in an ostensibly thread-safe way.

ivanz commented 7 years ago

Thanks for the fix!