Altinn / Altinn/altinn-studio-docs
Create developer handbook page for unit testing of C# projects
- Dominant language
- CSS
- Stars
- 15
- Forks
- 58
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 53
Description
## Description
There is a page for unit testing of our typescript code using Jest, but there are no page for unit testing of the C# code. There is such a document on AltinnPedia. This is an older page used in Altinn II development, but it is a good start for Altinn 3 as well.
## Considerations
Consider making some changes or additions:
The strict structure of the Summary for each unit test method. The test should be described by its method name. The Summary often feels redundant and can often end up being wrong when developers write new tests by copying existing tests.
Unit testing i Altinn 3 involve significant use of the TestServer harness provided by Microsoft. The TestServer is a very powerfull tool that can help with testing of code outside the method being tested E.g:
- Routing - Use it to verify that a http request triggers correct method.
- Authorization - Use it to verify that the method has correct Authorization attribute parameters.
All tests that are testing the internal logic of a method should try to do so without the help of TestServer.
There is an existing page on Altinn Studio Docs on Xunit testing that can be updated, but there might be room for some improvement to how we organize these documents.
## Acceptance criteria
Documentation on how to maintain unit tests for the C# projects can be found on docs.altinn.studio.
## Development tasks
- [ ] Write a document for unit testing of C# projects.
## Definition of done
Verify that this issue meets [DoD](https://confluence.brreg.no/display/T3KP/Definition+of+Done#DefinitionofDone-DoD%E2%80%93utvikling) (Only for project members) before closing.
- [ ] Documentation is updated (if relevant)
- [ ] Technical documentation (docs.altinn.studio)
- [ ] User documentation (altinn.github.io/docs)
- [ ] QA
- [ ] Manual test is complete (if relevant)
- [ ] Automated test is implemented (if relevant)
- [ ] All tasks in this userstory are closed (i.e. remaining tasks are moved to other user stories or marked obsolete)
Contributor guide
Research direction
Start by reviewing the existing Xunit testing page on Altinn Studio Docs and the older unit-testing document on AltinnPedia. Compare their guidance with the issue's requirements for C# tests, TestServer usage, and method summaries, then publish the completed guidance on docs.altinn.studio.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100