Esempio n. 1
0
        public void DeleteCohort_WhenCohortIsEmptyAndNotWithEmployer_ShouldThrowDomainException(Party party)
        {
            var f = new DeleteCohortHandlerTestsFixture();

            f.WithExistingCohort(Party.Employer).WithParty(party);

            Assert.ThrowsAsync <DomainException>(() => f.Handle());
        }
Esempio n. 2
0
        public async Task DeleteCohort_WhenNotApproved_ShouldEmitCohortDeletedEventWithNoPartyApprovals()
        {
            var f = new DeleteCohortHandlerTestsFixture();

            f.WithExistingCohort(Party.Employer).WithParty(Party.Employer);
            await f.Handle();

            f.VerifyCohortDeletedEventIsEmittedAndWasApprovedBy(Party.None);
        }
Esempio n. 3
0
        public async Task DeleteCohort_WhenCohortIsNotEmptyAndWithEmployer_ShouldEmitEventForDraftApprenticeshipBeingDeleted()
        {
            var f = new DeleteCohortHandlerTestsFixture();

            f.WithExistingCohort(Party.Employer).WithParty(Party.Employer).WithExistingDraftApprenticeship();
            await f.Handle();

            f.VerifyEventEmittedWhenDraftApprenticeshipIsDeleted();
        }
Esempio n. 4
0
        public async Task DeleteCohort_WhenCohortIsNotEmptyAndWithEmployer_ShouldMarkRemoveTheApprentice()
        {
            var f = new DeleteCohortHandlerTestsFixture();

            f.WithExistingCohort(Party.Employer).WithParty(Party.Employer).WithExistingDraftApprenticeship();
            await f.Handle();

            f.VerifyDraftApprenticeshipDeleted();
        }
Esempio n. 5
0
        public async Task DeleteCohort_WhenCohortIsEmptyAndWithEmployer_ShouldMarkCohortAsDeleted()
        {
            var f = new DeleteCohortHandlerTestsFixture();

            f.WithExistingCohort(Party.Employer).WithParty(Party.Employer);
            await f.Handle();

            f.VerifyCohortIsMarkedAsDeleted();
        }
Esempio n. 6
0
        public async Task DeleteCohort_WhenApprovedByProvider_ShouldEmitCohortDeletedEventWithProviderApproval()
        {
            var f = new DeleteCohortHandlerTestsFixture();

            f.WithExistingCohort(Party.Employer).WithParty(Party.Employer).WithExistingDraftApprenticeship()
            .WithProviderApproval();
            await f.Handle();

            f.VerifyCohortDeletedEventIsEmittedAndWasApprovedBy(Party.Provider);
        }