예제 #1
0
        public void CommitmentIsTransferFundedAndStatusesAreInvalid(TransferApprovalStatus transferApprovalStatus, EditStatus editStatus)
        {
            var commitment = new CommitmentListItem
            {
                AgreementStatus        = AgreementStatus.NotAgreed,
                ApprenticeshipCount    = 1,
                LastAction             = LastAction.None,
                EditStatus             = editStatus,
                TransferSenderId       = 1,
                TransferApprovalStatus = transferApprovalStatus
            };

            Assert.Throws <Exception>(() => commitment.GetStatus());
        }
        public void ThenTheRequestHasTheCorrectStatus(LastAction lastAction, AgreementStatus agreementStatus, RequestStatus expectRequestStatus)
        {
            var commitment = new CommitmentListItem
            {
                LastAction          = lastAction,
                AgreementStatus     = agreementStatus,
                EditStatus          = EditStatus.ProviderOnly,
                ApprenticeshipCount = 2
            };

            //Act
            var status = commitment.GetStatus();

            //Assert
            Assert.AreEqual(expectRequestStatus, status);
        }
예제 #3
0
        public void CommitmentIsTransferFundedAndInValidState(RequestStatus expectedResult, EditStatus editStatus, TransferApprovalStatus transferApprovalStatus)
        {
            var commitment = new CommitmentListItem
            {
                AgreementStatus        = AgreementStatus.NotAgreed,
                ApprenticeshipCount    = 1,
                LastAction             = LastAction.None,
                EditStatus             = editStatus,
                TransferSenderId       = 1,
                TransferApprovalStatus = transferApprovalStatus
            };

            var status = commitment.GetStatus();

            Assert.AreEqual(expectedResult, status);
        }
예제 #4
0
        public void WhenThereAreNoApprentices(RequestStatus expectedResult, LastAction lastAction)
        {
            var commitment = new CommitmentListItem
            {
                LastAction = lastAction,

                EditStatus             = EditStatus.Both,
                ApprenticeshipCount    = 2,
                AgreementStatus        = AgreementStatus.BothAgreed,
                ProviderLastUpdateInfo = new LastUpdateInfo()
            };

            var status = commitment.GetStatus();

            status.Should().Be(expectedResult);
        }