コード例 #1
0
        public async Task CheckQualificationDateValidation_WithPassedDate_ThrowsBusinessException()
        {
            var tender = new TenderDefault().GetGeneralTender();

            tender.UpdateTenderDates(DateTime.Now, DateTime.Now.AddDays(-1), DateTime.Now, DateTime.Now.AddDays(5),
                                     null, null, null, null,
                                     null, null, null,
                                     null, null);
            var e = Assert.ThrowsAsync <BusinessRuleException>(async() =>
                                                               await _Sut.CheckQualificationDateValidation(tender));

            Assert.Equal(Resources.QualificationResources.ErrorMessages.AfterDate, e.Result.Message);
        }
コード例 #2
0
        IsValidToSendQualificationForApprovement_WithCheckingDateLessThanPresentationDate_ThrowsBusinessException()
        {
            var tender = new TenderDefault().GetGeneralTender();

            tender.UpdateTenderDates(DateTime.Now.AddDays(1), DateTime.Now.AddDays(3), DateTime.Now,
                                     DateTime.Now.AddDays(2), null, null, null, null,
                                     null, null, null,
                                     null, null);
            tender.UpdateTenderStatus(Enums.TenderStatus.Established, "", 1221, Enums.TenderActions.ExtenedTenderDates);

            var e = Assert.ThrowsAsync <BusinessRuleException>(async() =>
                                                               await _Sut.IsValidToSendQualificationForApprovement(tender));

            Assert.Equal("تاريخ فحس التاهيل يجب أن يكون أكبر من اخر موعد لاستلام العروض", e.Result.Message);
        }
コード例 #3
0
        public async Task IsValidToApproveQualification_WithPassedDate_ThrowsBusinessException()
        {
            var tender = new TenderDefault().GetGeneralTender();

            tender.UpdateTenderDates(DateTime.Now, DateTime.Now.AddDays(-1), DateTime.Now, DateTime.Now, null, null,
                                     null, null,
                                     null, null, null,
                                     null, null);
            tender.UpdateTenderStatus(Enums.TenderStatus.Pending, "", 1221, Enums.TenderActions.ExtenedTenderDates);

            var e = Assert.ThrowsAsync <BusinessRuleException>(async() =>
                                                               await _Sut.IsValidToApproveQualification(tender));

            Assert.Equal(Resources.QualificationResources.ErrorMessages.IsValidQualificationDateForApprovement,
                         e.Result.Message);
        }
コード例 #4
0
        public async Task IsValidToSendQualificationForApprovement_WithAnyDateLessThanToday_ThrowsBusinessException()
        {
            var tender = new TenderDefault().GetGeneralTender();

            tender.UpdateTenderDates(DateTime.Now, DateTime.Now.AddDays(-1), DateTime.Now, DateTime.Now, null, null,
                                     null, null,
                                     null, null, null,
                                     null, null);
            tender.UpdateTenderStatus(Enums.TenderStatus.Established, "", 1221, Enums.TenderActions.ExtenedTenderDates);

            var e = Assert.ThrowsAsync <BusinessRuleException>(async() =>
                                                               await _Sut.IsValidToSendQualificationForApprovement(tender));

            Assert.Equal(Resources.QualificationResources.ErrorMessages.QualificationDateMustBelargeThanToday,
                         e.Result.Message);
        }
コード例 #5
0
        public async Task IsValidToApprovePreQualificationFromCommitteeManager_WithPassedDate_ThrowsBusinessException(
            string agencyCode)
        {
            var tender = new TenderDefault().GetGeneralTender();

            tender.UpdateTenderDates(DateTime.Now, DateTime.Now.AddDays(-1), DateTime.Now, DateTime.Now, null, null,
                                     null, null,
                                     null, null, null,
                                     null, null);
            tender.UpdateTenderStatus(Enums.TenderStatus.PendingQualificationCommitteeManagerApproval, "", 1221,
                                      Enums.TenderActions.ExtenedTenderDates);

            var e = Assert.ThrowsAsync <BusinessRuleException>(async() =>
                                                               await _Sut.IsValidToApprovePreQualificationFromCommitteeManager(tender, agencyCode));

            Assert.Equal(Resources.QualificationResources.Messages.CantApprovePresentaionDatePassed, e.Result.Message);
        }
コード例 #6
0
        IsValidToSendQualificationForApprovementFromCommitteeManager_WithPresentationDateLessThanEnquiryDate_ThrowsBusinessException()
        {
            var tender = new TenderDefault().GetGeneralTender();

            tender.SetPointToPassToQualification(7, 40, 30, 1);

            tender.UpdateTenderDates(DateTime.Now.AddDays(2), DateTime.Now.AddDays(1), DateTime.Now,
                                     DateTime.Now.AddDays(3), null, null, null, null,
                                     null, null, null,
                                     null, null);
            tender.UpdateTenderStatus(Enums.TenderStatus.QualificationUnderEstablishingFromCommittee, "", 1221,
                                      Enums.TenderActions.ExtenedTenderDates);

            var e = Assert.ThrowsAsync <BusinessRuleException>(async() =>
                                                               await _Sut.IsValidToSendQualificationForApprovementFromCommitteeManager(tender));

            Assert.Equal("اخر موعد تقديم فحص التاهيل يجب أن يكون أكبر من  اخر موعد لاستلام استفسارات",
                         e.Result.Message);
        }