integration tests
Some checks failed
CI / lint-typecheck (pull_request) Failing after 4m50s
CI / tests (pull_request) Has been skipped
CI / contract-tests (pull_request) Has been skipped
CI / e2e-tests (pull_request) Has been skipped
CI / comment-pr (pull_request) Has been skipped
CI / commit-types (pull_request) Has been skipped
Some checks failed
CI / lint-typecheck (pull_request) Failing after 4m50s
CI / tests (pull_request) Has been skipped
CI / contract-tests (pull_request) Has been skipped
CI / e2e-tests (pull_request) Has been skipped
CI / comment-pr (pull_request) Has been skipped
CI / commit-types (pull_request) Has been skipped
This commit is contained in:
54
tests/integration/sponsor/SponsorTestContext.ts
Normal file
54
tests/integration/sponsor/SponsorTestContext.ts
Normal file
@@ -0,0 +1,54 @@
|
||||
import { Logger } from '../../../core/shared/domain/Logger';
|
||||
import { InMemorySponsorRepository } from '../../../adapters/racing/persistence/inmemory/InMemorySponsorRepository';
|
||||
import { InMemorySeasonSponsorshipRepository } from '../../../adapters/racing/persistence/inmemory/InMemorySeasonSponsorshipRepository';
|
||||
import { InMemorySeasonRepository } from '../../../adapters/racing/persistence/inmemory/InMemorySeasonRepository';
|
||||
import { InMemoryLeagueRepository } from '../../../adapters/racing/persistence/inmemory/InMemoryLeagueRepository';
|
||||
import { InMemoryLeagueMembershipRepository } from '../../../adapters/racing/persistence/inmemory/InMemoryLeagueMembershipRepository';
|
||||
import { InMemoryRaceRepository } from '../../../adapters/racing/persistence/inmemory/InMemoryRaceRepository';
|
||||
import { InMemoryPaymentRepository } from '../../../adapters/payments/persistence/inmemory/InMemoryPaymentRepository';
|
||||
import { InMemorySponsorshipPricingRepository } from '../../../adapters/racing/persistence/inmemory/InMemorySponsorshipPricingRepository';
|
||||
import { InMemoryEventPublisher } from '../../../adapters/events/InMemoryEventPublisher';
|
||||
|
||||
export class SponsorTestContext {
|
||||
public readonly logger: Logger;
|
||||
public readonly sponsorRepository: InMemorySponsorRepository;
|
||||
public readonly seasonSponsorshipRepository: InMemorySeasonSponsorshipRepository;
|
||||
public readonly seasonRepository: InMemorySeasonRepository;
|
||||
public readonly leagueRepository: InMemoryLeagueRepository;
|
||||
public readonly leagueMembershipRepository: InMemoryLeagueMembershipRepository;
|
||||
public readonly raceRepository: InMemoryRaceRepository;
|
||||
public readonly paymentRepository: InMemoryPaymentRepository;
|
||||
public readonly sponsorshipPricingRepository: InMemorySponsorshipPricingRepository;
|
||||
public readonly eventPublisher: InMemoryEventPublisher;
|
||||
|
||||
constructor() {
|
||||
this.logger = {
|
||||
info: () => {},
|
||||
debug: () => {},
|
||||
warn: () => {},
|
||||
error: () => {},
|
||||
} as unknown as Logger;
|
||||
|
||||
this.sponsorRepository = new InMemorySponsorRepository(this.logger);
|
||||
this.seasonSponsorshipRepository = new InMemorySeasonSponsorshipRepository(this.logger);
|
||||
this.seasonRepository = new InMemorySeasonRepository(this.logger);
|
||||
this.leagueRepository = new InMemoryLeagueRepository(this.logger);
|
||||
this.leagueMembershipRepository = new InMemoryLeagueMembershipRepository(this.logger);
|
||||
this.raceRepository = new InMemoryRaceRepository(this.logger);
|
||||
this.paymentRepository = new InMemoryPaymentRepository(this.logger);
|
||||
this.sponsorshipPricingRepository = new InMemorySponsorshipPricingRepository(this.logger);
|
||||
this.eventPublisher = new InMemoryEventPublisher();
|
||||
}
|
||||
|
||||
public clear(): void {
|
||||
this.sponsorRepository.clear();
|
||||
this.seasonSponsorshipRepository.clear();
|
||||
this.seasonRepository.clear();
|
||||
this.leagueRepository.clear();
|
||||
this.leagueMembershipRepository.clear();
|
||||
this.raceRepository.clear();
|
||||
this.paymentRepository.clear();
|
||||
this.sponsorshipPricingRepository.clear();
|
||||
this.eventPublisher.clear();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user