diff --git a/_static/images/visual_studio_create_unit_tests.png b/_static/images/visual_studio_create_unit_tests.png new file mode 100644 index 0000000..85774a6 Binary files /dev/null and b/_static/images/visual_studio_create_unit_tests.png differ diff --git a/_static/images/visual_studio_create_unit_tests_context_menu.png b/_static/images/visual_studio_create_unit_tests_context_menu.png new file mode 100644 index 0000000..81b41fb Binary files /dev/null and b/_static/images/visual_studio_create_unit_tests_context_menu.png differ diff --git a/guidelines/cs.rst b/guidelines/cs.rst new file mode 100644 index 0000000..1fa2471 --- /dev/null +++ b/guidelines/cs.rst @@ -0,0 +1,50 @@ +==== + C# +==== + +C# is to be created using respective Visual Studio Project templates. +Usage of a strict pattern like *MVVM* or *MVC*. +The respective usage is to be documented in the project you are using. + +Every class should be put into a separate file. +This ensures assignability when creating `tests `_ +Feel free to add directories for a more concise structure of your project. + +--------------- + Documentation +--------------- + +Since projects are not created using `copier` templates the documentation has to be added using the `copier-documentation <../copier-documentation>`_ template. + +Inline documentation can be added using `sphinx-autoapi `_. + +.. TODO + +--------- + Testing +--------- + +Testing is mandatory and has to be included in every commit. +For *C#* `xUnit `_ is to be used. +It is recommended to you `this extension `_ to be able to easily add tests to your project. + + +.. image:: /_static/images/visual_studio_create_unit_tests_context_menu.png + :align: left + :width: 40 % + +.. image:: /_static/images/visual_studio_create_unit_tests.png + :align: right + :width: 50 % + + +The settings in :code:`Create Unit Tests` should not be changed. +If a test project already exists for your respective code you should select it. + +For better readability of your tests use `FluentAssertions `_. + +Mocks are created using `FakeItEasy `_. + +Code coverage can not be checked using the Visual Studio Community edition, as this feature is only enabled for the `Visual Studio Enterprise `_ edition. + +.. TODO Maybe code coverage can be checked using github actions? diff --git a/index.rst b/index.rst index fc11ef9..a64c659 100644 --- a/index.rst +++ b/index.rst @@ -7,6 +7,8 @@ :maxdepth: 2 :caption: Contents: + guidelines/cs.rst + ---------- Projects