1

I have controller with following action :

[Topic("pubsub", "test")]
[HttpPost("test")]
public async Task Post([FromBody] CustomDto customDto)
{
    await _customService.Execute(customDto, CancellationToken.None);
}

I want to test it via mocking something. Couldn't find any useful resource how to do it. The goal is be able to send CustomDto to this action and further execution.

  • if you have a custom body you need to be able to serialize on the client and deserialize on the server. Than server would need to be able to process the customize data. You have a DTO which implies the back end of your application is a database. So the server code you need to be able to process the custom data and then know how to send results of processing to the database. – jdweng Apr 11 '23 at 14:47
  • Which Unit test framework are you using? – HungryWolf Jul 24 '23 at 11:25

0 Answers0