Contributions - nsubstitute/NSubstitute GitHub Wiki

Want to contribute? Awesome!

Bug fixes

We love those. Fork and fix away!

New features or enhancements

It's a good idea to raise an issue with the details of the intended change before starting work. This helps maintain project coherence and avoid duplication of effort.

Of course if inspiration hits you in the wee late hours, feel free to crank out a change and send it on to us.

Ideas for contributing

Want to contribute, but not sure what to work on? Try looking through current issues, specifically those labelled up-for-grabs.

Notes

  • You'll need these prerequisites.
  • Fork the main repository and make your changes, then send us a pull request. Check the GitHub guide for more information.
  • Your change should be covered by tests. Depending on the change you might want to include unit tests, but at a minimum you should add acceptance tests that test and describe the change.
  • It will make things easier for us if you try to get your change to follow a similar style to the code around it.
  • We appreciate all patches and pull requests, but are conscious of the fact projects are defined just as much by what features they choose to exclude as what features they include. For this reason we can't guarantee that all patches will be included.

Dev style notes

  • For unit tests/specs, don't use NSubstitute for mocking. Take a look at the MockingAdaptor class. We use this in unit tests by calling mock<T>() to create a mock. Under the hood this uses Rhino Mocks, just so we test using something independent from NSubstitute's implementation. For acceptance tests/specs, NSubstitute should be used directly (as that's what's being tested).