I'm mocking a method using Moq and I want the method to return null but it's not returning null and I'm not sure why.
This is my setup code:
var mock2 = new Mock<ReminderRepository>(stubPatientRemindersDBModelContainer);
mock2.CallBase = true;
mock2.Setup(x => x.GetPatientEscalations(userName, patientId, startDateTime, endDateTime, new DataTable()))
.Returns((PatientEscalationsDto)null);
When debugging, I was hoping that the variable assigned to GetPatientEscalations would be null but it isn't.
What am I doing wrong?