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:
42
tests/integration/rating/RatingTestContext.ts
Normal file
42
tests/integration/rating/RatingTestContext.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
import { InMemoryDriverRepository } from '../../../../core/racing/infrastructure/repositories/InMemoryDriverRepository';
|
||||
import { InMemoryRaceRepository } from '../../../../core/racing/infrastructure/repositories/InMemoryRaceRepository';
|
||||
import { InMemoryLeagueRepository } from '../../../../core/racing/infrastructure/repositories/InMemoryLeagueRepository';
|
||||
import { InMemoryResultRepository } from '../../../../core/racing/infrastructure/repositories/InMemoryResultRepository';
|
||||
import { InMemoryRatingRepository } from '../../../../core/rating/infrastructure/repositories/InMemoryRatingRepository';
|
||||
import { InMemoryEventPublisher } from '../../../../adapters/events/InMemoryEventPublisher';
|
||||
|
||||
export class RatingTestContext {
|
||||
private static instance: RatingTestContext;
|
||||
|
||||
public readonly driverRepository: InMemoryDriverRepository;
|
||||
public readonly raceRepository: InMemoryRaceRepository;
|
||||
public readonly leagueRepository: InMemoryLeagueRepository;
|
||||
public readonly resultRepository: InMemoryResultRepository;
|
||||
public readonly ratingRepository: InMemoryRatingRepository;
|
||||
public readonly eventPublisher: InMemoryEventPublisher;
|
||||
|
||||
private constructor() {
|
||||
this.driverRepository = new InMemoryDriverRepository();
|
||||
this.raceRepository = new InMemoryRaceRepository();
|
||||
this.leagueRepository = new InMemoryLeagueRepository();
|
||||
this.resultRepository = new InMemoryResultRepository();
|
||||
this.ratingRepository = new InMemoryRatingRepository();
|
||||
this.eventPublisher = new InMemoryEventPublisher();
|
||||
}
|
||||
|
||||
public static create(): RatingTestContext {
|
||||
if (!RatingTestContext.instance) {
|
||||
RatingTestContext.instance = new RatingTestContext();
|
||||
}
|
||||
return RatingTestContext.instance;
|
||||
}
|
||||
|
||||
public async clear(): Promise<void> {
|
||||
await this.driverRepository.clear();
|
||||
await this.raceRepository.clear();
|
||||
await this.leagueRepository.clear();
|
||||
await this.resultRepository.clear();
|
||||
await this.ratingRepository.clear();
|
||||
this.eventPublisher.clear();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user