C#C
C#16mo ago
Denge

Testing multi layered .NET application

Hey, I'm new to C#/.NET and i'm currently making my first project.
This project has a Controller - Service - Repository structure.
Right now I'm trying to write tests for my controllers but I'm facing a problem trying to mock my service.
In the setup of my mock, i pass the data it should return, but the result is null (without the returned data)

Can anyone help me? I have added screenshots of the code.
Schermafbeelding_2024-09-04_om_15.53.56.png
Schermafbeelding_2024-09-04_om_15.53.22.png
Schermafbeelding_2024-09-04_om_15.54.21.png
Was this page helpful?