public void CheckInvariantValidationRules() { Action<CreateInstructorWithCourses.Request> CallSut = request => { var serviceUnderTest = new CreateInstructorWithCoursesHandlerFactory().Object; serviceUnderTest.Handle(request); }; // Assert2.CheckInvariantValidation("[ErrorMessage]", () => CallSut(CreateValidRequest(p => p.CommandModel. ))); }
public void CheckContextualValidationRules() { Func<CreateInstructorWithCourses.Request, ValidationMessageCollection> CallSut = request => { var serviceUnderTest = new CreateInstructorWithCoursesHandlerFactory().Object; var reponse = serviceUnderTest.Handle(request); return reponse.ValidationDetails; }; // Assert2.CheckValidation( "[ExpectedMessage]", "[PropertyName]", () => CallSut(CreateValidRequest(p => p.CommandModel.DummyValue = "1"))); }