コード例 #1
0
 public async Task CheckPreQualificationDataValidation(SupplierPreQualificationDocumentModel model)
 {
     if (model.PreQualificationResult == null)
     {
         throw new BusinessRuleException(Resources.QualificationResources.ErrorMessages.SelectQualificationResult);
     }
     if (model.RejectionReason == null && model.PreQualificationResult == (int)Enums.OfferTechnicalEvaluationStatusId.NotIdenticalOffer)
     {
         throw new BusinessRuleException(Resources.QualificationResources.ErrorMessages.EnterRejectedReason);
     }
 }
コード例 #2
0
        public async Task ShouldPostQualificationChecking()
        {
            MoqUser();
            _MoqSupplierqualificationdocumentqueries
            .Setup(x => x.FindSupplierPreQualificationDocumentById(It.IsAny <int>())).Returns(
                () =>
            {
                return(Task.FromResult(new QualificationDefault().GetSupplierPreQualificationDocument()));
            });
            _MoqQualificationDomainService
            .Setup(x => x.CheckApplyingDuplicationValidation(It.IsAny <int>(), It.IsAny <string>()))
            .Returns((int x, string y) => { return(Task.CompletedTask); });
            SupplierPreQualificationDocumentModel supplierPreQualificationDocumentModel =
                new SupplierPreQualificationDocumentModel();

            supplierPreQualificationDocumentModel.SupplierPreQualificationDocumentId = 1;
            supplierPreQualificationDocumentModel.PreQualificationResult             = 14;

            var result = await _sut.PostQualificationChecking(supplierPreQualificationDocumentModel);

            Assert.Null(result);
        }