18 Star 133 Fork 63

编程语言算法集 / C-Sharp

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
CONTRIBUTING.md 2.83 KB
一键复制 编辑 原始数据 按行查看 历史
pea-sys 提交于 2022-10-01 14:26 . Update from .NET 5 to .NET 6 (#328)

Contributing

General notes

When contributing to this repository, if your changes are subjective, controversial or people are likely to have polarized opinions on this matter, please first discuss the change you wish to make via issue with the owners of this repository.

We welcome adding new algorithms and data structures that were mentioned in books or other reputable sources. We also welcome fixing bugs in code, clarifying documentation and adding new test cases to check existing code. The framework targeted by our code is dotnet 6. The corresponding SDK can be found here.

Please note that we have a code of conduct, please follow it in all your interactions with the project.

Files

For adding new algorithms, please ensure to name the cs-files corresponding to the classname, e.g. Factorial.cs for the class Factorial and add them to the most relevant pre-existing folder. Make sure to implement tests for all public methods. These tests should be added in a separate cs-file to the corresponding folder in Algorithms.Tests and have their classname ending in "Test", e.g. FactorialTest.

Tests

We use the NUnit-library for testing. Instructions for the installation for local testing can be found here. A basic test can be implemented by adding the attribute [Test] in front of the method performing the test and including an Assert-statement within the method, e.g. Assert.AreEqual(result, 42). If possible, please use FluentAssertions since they are more eloquent and readable. Some of the basic assertions can be found here. For getting familiar with the Nunit-tests, it might be helpful to have a look at some existing test-files. A tutorial explaining how to implement and run NUnit-tests can be found here.

Automatic checks

One of the automatic checks we use is codecov. It checks whether each conditional branch is covered by a test. So if a method contains a conditional statement or operator (if-else, switch, ?: ) then there should be at least a test per branch (unless all the branches can be covered in one run).

The coding style follows the default code formatter of Visual Studio.

Comments

Please use the XML documentation features for comments. The comments should include a summary of the class/method and an explanation of the different parameters and of the return value. Including a link to Wikipedia or to another source of information on the algorithm is encouraged.

C#
1
https://gitee.com/TheAlgorithms/C-Sharp.git
git@gitee.com:TheAlgorithms/C-Sharp.git
TheAlgorithms
C-Sharp
C-Sharp
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891