public void Arrange() { var fixture = new Fixture(); _standardResponse = fixture.Create <Standard>(); _certificateResponse = new Certificate { StandardCode = 1 }; _mockMediator = new Mock <IMediator>(); _mockGetValidator = new Mock <IValidator <GetBatchCertificateRequest> >(); _mockMediator.Setup(m => m.Send(It.IsAny <GetStandardVersionRequest>(), It.IsAny <CancellationToken>())) .ReturnsAsync(_standardResponse); _mockMediator.Setup(m => m.Send(It.IsAny <GetBatchCertificateRequest>(), It.IsAny <CancellationToken>())) .ReturnsAsync(_certificateResponse); _mockGetValidator.Setup(validator => validator.ValidateAsync(It.IsAny <GetBatchCertificateRequest>(), It.IsAny <CancellationToken>())) .ReturnsAsync(new ValidationResult()); _controller = new CertificateBatchController(_mockMediator.Object, _mockGetValidator.Object, Mock.Of <IValidator <CreateBatchCertificateRequest> >(), Mock.Of <IValidator <UpdateBatchCertificateRequest> > (), Mock.Of <IValidator <SubmitBatchCertificateRequest> >(), Mock.Of <IValidator <DeleteBatchCertificateRequest> >()); }
public void SetUp() { _mockMediator = new Mock <IMediator>(); _mockCreateBatchValidator = new Mock <IValidator <CreateBatchCertificateRequest> >(); _mockUpdateBatchValidator = new Mock <IValidator <UpdateBatchCertificateRequest> >(); _mockGetBatchValidator = new Mock <IValidator <GetBatchCertificateRequest> >(); _mockSubmitBatchValidator = new Mock <IValidator <SubmitBatchCertificateRequest> >(); _mockDeleteBatchValidator = new Mock <IValidator <DeleteBatchCertificateRequest> >(); _certificateBatchController = new CertificateBatchController(_mockMediator.Object, _mockGetBatchValidator.Object, _mockCreateBatchValidator.Object, _mockUpdateBatchValidator.Object, _mockSubmitBatchValidator.Object, _mockDeleteBatchValidator.Object); }