Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 50 additions & 0 deletions guidelines/cs.rst
Original file line number Diff line number Diff line change
@@ -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 <Testing_>`_
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 <https://sphinx-autoapi.readthedocs.io/en/latest/tutorials.html#net>`_.

.. TODO

---------
Testing
---------

Testing is mandatory and has to be included in every commit.
For *C#* `xUnit <https://xunit.net/>`_ is to be used.
It is recommended to you `this extension <https://marketplace.visualstudio.com/items?itemName=YowkoTsai.xUnitnetTestGenerator>`_ 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 <https://github.com/fluentassertions/fluentassertions>`_.

Mocks are created using `FakeItEasy <https://github.com/FakeItEasy/FakeItEasy>`_.

Code coverage can not be checked using the Visual Studio Community edition, as this feature is only enabled for the `Visual Studio Enterprise <https://docs.microsoft.com/en-us/visualstudio/test/using-code-coverage-to-determine-how-much-code-is-being-tested?view=vs-2022>`_ edition.

.. TODO Maybe code coverage can be checked using github actions?
2 changes: 2 additions & 0 deletions index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
:maxdepth: 2
:caption: Contents:

guidelines/cs.rst


----------
Projects
Expand Down