I have a code construct as below in the SUT
public class SUT
{
//...
public void Process()
{
// Does some work and creates new myDto(), and assigns field values.
Update(myDto);
}
private void Update(MyDto myDto)
{
_repository.Update(myDto);
}
}
I am passing a mock for _repository in my unit tests. I would like to verify if the Fields are properly set before invoking the Update(MyDto myDto) method
Is there a way to get the reference of the argument object through mock?
I would like to assert against the fields of the passed object myDto.
Something like.
Assert.AreEqual(1, myDto.Field1);
If not what are my options.
I am using MSTest and Moq.