Пример #1
0
        public async Task ThenCountsShouldBeCorrectWhenEmployerHasASingleCommitmentThats(
            int expectedDraftCount, int expectedReadyForReviewCount, int expectedWithProviderCount, int expectedTransferFundedCohortsCount, int expectedRejectedTransferFundedCohortsCount,
            long?transferSenderId, TransferApprovalStatus transferApprovalStatus,
            AgreementStatus agreementStatus, EditStatus editStatus, LastAction lastAction, int apprenticeshipCount)
        {
            //Arrange
            MockMediator.Setup(x => x.SendAsync(It.IsAny <GetCommitmentsQuery>()))
            .ReturnsAsync(new GetCommitmentsResponse
            {
                Commitments = new List <CommitmentListItem>
                {
                    new CommitmentListItem
                    {
                        TransferSenderId       = transferSenderId,
                        TransferApprovalStatus = transferApprovalStatus,
                        AgreementStatus        = agreementStatus,
                        EditStatus             = editStatus,
                        LastAction             = lastAction,
                        ApprenticeshipCount    = apprenticeshipCount
                    }
                }
            });

            //Act
            var result = await EmployerCommitmentOrchestrator.GetYourCohorts("ABC123", "ABC321");

            //Assert
            Assert.AreEqual(expectedDraftCount, result.Data.DraftCount, "Incorrect DraftCount");
            Assert.AreEqual(expectedReadyForReviewCount, result.Data.ReadyForReviewCount, "Incorrect ReadyForReviewCount");
            Assert.AreEqual(expectedWithProviderCount, result.Data.WithProviderCount, "Incorrect WithProviderCount");
            Assert.AreEqual(expectedTransferFundedCohortsCount, result.Data.TransferFundedCohortsCount, "IncorrectTransferFundedCohortsCount");
            Assert.AreEqual(expectedRejectedTransferFundedCohortsCount, result.Data.RejectedTransferFundedCohortsCount, "IncorrectRejectedTransferFundedCohortsCount");
        }
Пример #2
0
        public async Task ThenAllCountsShouldBeZeroIfNoCommitments()
        {
            //Arrange
            MockMediator.Setup(x => x.SendAsync(It.IsAny <GetCommitmentsQuery>()))
            .ReturnsAsync(new GetCommitmentsResponse
            {
                Commitments = new List <CommitmentListItem>()
            });

            //Act
            var result = await EmployerCommitmentOrchestrator.GetYourCohorts("ABC123", "ABC321");

            //Assert
            Assert.AreEqual(0, result.Data.DraftCount, "Incorrect DraftCount");
            Assert.AreEqual(0, result.Data.ReadyForReviewCount, "Incorrect ReadyForReviewCount");
            Assert.AreEqual(0, result.Data.WithProviderCount, "Incorrect WithProviderCount");
            Assert.AreEqual(0, result.Data.TransferFundedCohortsCount, "IncorrectTransferFundedCohortsCount");
            Assert.AreEqual(0, result.Data.RejectedTransferFundedCohortsCount, "IncorrectRejectedTransferFundedCohortsCount");
        }