I'm purposefully trying to pass a bad setup for moq and I'm expecting an error. I'm passing a class to my setup method, where I would like the instance variables under a certain criteria. Since I create a new instance of the class, I would expect an error, since all the instance variables are null. However, nothing gets thrown?
var mockParams = new object[] { mockRequestRepo.Object, mockNotificationSvc.Object, mockLogger.Object, mockNotificationBuilder.Object };
var mockActivityReportBO = new Mock<ActivityReport>(mockParams);
// Instance variables for class.
mockActivityReportBO.Setup(x => x.AddReport(It.Is<ActivityReport>(
x => x.Title == It.IsAny<string>()
&& x.Limits == It.IsAny<string>()
&& x.Description == It.IsAny<string>()
&& x.DueDate == It.IsInRange(DateTime.Now.AddDays(12), DateTime.MaxValue, Range.Inclusive)
&& x.CountyNumber == It.IsInRange(1, 5, Range.Inclusive)
&& x.ActivityReportID == It.IsInRange(1, 12, Range.Inclusive)
)));
var report = new ActivityReport();
// No error thrown
mockActivityReportBO.Object.AddReport(report);