AutoFixture is currently being developed in C# 10 and F# 6 on .NET Framework V4.6.2, .NET Standard 2.0, and .NET 6 using Visual Studio 2022 or later, with xUnit.net as the unit testing framework. So far, all development has been done with TDD, so there's a pretty high degree of code coverage, and the aim is to keep it that way.
Before continuing, make sure that you are familiar with the Code of Conduct document, as it applies to all interactions within the project.
Issues in GitHub have historically been a very overloaded term that, depending on the repository, can mean different things, from bugs to feature ideas to be implemented some time in the future, so it's common for people carry assumptions from other repositories they interacted with. However, this project reserves the use of Issues only to bugs, tasks, and vulnerability reports, that have been confirmed by a maintainer. All other discussions (e.g. feature ideas, questions, etc.) are reserved to the Discussions section. Follow the suggestions in the New Issue menu, to ensure you have picked the correct option.
When opening a new issue, follow the instructions included with the template. DO NOT alter the template structure. Issues not following the template might be ignored and even closed.
AutoFixture uses NUKE as a build engine. If you would like to build the AutoFixture locally, run the build.cmd
file and wait for the result.
The repository state (the last tag name and number of commits since the last tag) is used to determine the build version. This process is automated using GitVersion
Refer to the output of build.cmd --help
to get information about all the supported build paramters.
As part of the verification build, Code Analysis is executed in a configuration that treats warnings as errors. For unit test projects code most of the rules are suppressed so only missing warnings are expected. No CA warnings should be suppressed unless the documented conditions for suppression are satisfied. Otherwise, a documented agreement between at least two active developers of the project should be reached to allow a suppression of a non-suppressible warning.
The final step of the CI pipeline will be running full solution test coverage. While there are no strict rules on the test coverage ensure that all new flows have been properly tested and documented.
To ensure all rules are respected, before publishing the PR, run the command below from the root directory of the repository.
This will verify that all required code practices have been followed, run all tests in the solution, and will generate a HTML coverage report (located in ./artifacts/reports/
) that you can inspect to ensure you've covered all updated flows.
build.cmd Verify Cover --no-logo --configuration Release
When developing for AutoFixture, please respect the coding style already present. Look around in the source code to get a feel for it.
Please keep line lengths under 120 characters. Line lengths over 120 characters don't fit into the standard GitHub code listing window, so it requires vertical scrolling to review.
Also, please follow the Open Source Contribution Etiquette. AutoFixture is a fairly typical open source project: if you want to contribute, start by creating a fork and sending a pull request when you have something you wish to commit. When creating pull requests, please keep the Single Responsibility Principle in mind. A pull request that does a single thing very well is more likely to be accepted. See also the article The Rules of the Open Road for more good tips on working with OSS and Pull Requests, as well as these 10 tips for better Pull Requests.
For complex pull requests, you are encouraged to first start a discussion in the Discussions section. This can save you time, because the AutoFixture regulars can help verify your idea, or point you in the right direction.
Some existing issues are marked with the good first issue
tag. These are good candidates to attempt, if you are just getting started with AutoFixture.
When you submit a pull request, you can expect a response within a day or two. We (the maintainers of AutoFixture) have day jobs, so we may not be able to immediately review your pull request, but we do make it a priority. Also keep in mind that we may not be in your time zone.
Most likely, when we review pull requests, we will make suggestions for improvement. This is normal, so don't interpret it as though we don't like your pull request. On the contrary, if we agree on the overall goal of the pull request, we want to work with you to make it a success.
AutoFixture follows Semantic Versioning 2.0.0 for the public releases (published to the nuget.org).
AutoFixture has been set up for Continuous Integration. The build is in GitHub Actions and runs automatically every time a new commit is pushed to any of the public branches or a Pull Request is submitted. AutoFixture uses GitHub's Commit Status API to prevent Pull Requests that don't pass the build from being accidentally merged.
The build process is implemented in the _build
project using NUKE and consists of four main steps:
- Compile all projects
- Run static analysis on all projects using FxCop and Roslyn Analyzers package.
- Run all tests
- Create NuGet packages
The NuGet packages produced by the latest build can be downloaded directly from Releases.