2
Answers

Moq unit testing for void methods

Suraj Rai

Suraj Rai

12y
7.2k
1

Hi,

I am working on a component based application. I have a method that does some calculation and returns nothing.

say:

public void DoSomething(int x, int y)
{
       // do something
}

How to write testing for it.
I can pass some dummy x,y values. But how and what we can Assert in the unit test project.

Any help would be appreciated.

Thanks.
Regards

Answers (2)