Beispiel #1
0
        public void DeleteCohort_WhenCohortIsEmptyAndNotWithEmployer_ShouldThrowDomainException(Party party)
        {
            var f = new DeleteCohortHandlerTestsFixture();

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

            Assert.ThrowsAsync <DomainException>(() => f.Handle());
        }
Beispiel #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);
        }
Beispiel #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();
        }
Beispiel #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();
        }
Beispiel #5
0
        public async Task DeleteCohort_WhenCohortIsEmptyAndWithEmployer_ShouldMarkCohortAsDeleted()
        {
            var f = new DeleteCohortHandlerTestsFixture();

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

            f.VerifyCohortIsMarkedAsDeleted();
        }
Beispiel #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);
        }