Closed JimKay1941 closed 7 years ago
It seem your system is editing out > and < so I will have to resubmit them. private Mock<DateTime> mockDateTime; this.mockDateTime = this.mockRepository.Create<DateTime>();
Thanks for the report. Some types are not mockable, in this case DateTime. You'll need to create and inject it yourself. If I made a change here it would be to detect that DateTime is a non-mockable struct and insert "TODO" instead.
Indeed, I have already done the inject myself.
I was only suggesting you make the change to detect DateTime as non-mockable.
Thanks again for the reply and for your extension! It really helps me.
Fixed in 1.5.10. We no longer try to make mock objects out of non-reference types.
¡Muchas Gracias!
Installed product versions
Description
I have a class, Student with a constructor having a DateTime object in the argument list.
The extension created these statements: private Mock mockDateTime;
mockDateTime = mockRepository.Create();
Steps to recreate
Current behavior
The generated statements cannot be copiled.
Expected behavior
Put DateTime directly in the argument list and do not attempt to use moq.