mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 07:50:31 +00:00
rename build method to buildForTesting
This commit is contained in:
@@ -5,6 +5,7 @@ import { UnoptimizedInMemoryShuttleRepository } from "../repositories/Unoptimize
|
|||||||
import { RedisNotificationRepository } from "../repositories/RedisNotificationRepository";
|
import { RedisNotificationRepository } from "../repositories/RedisNotificationRepository";
|
||||||
import { NotificationRepository } from "../repositories/NotificationRepository";
|
import { NotificationRepository } from "../repositories/NotificationRepository";
|
||||||
import { ShuttleGetterSetterRepository } from "../repositories/ShuttleGetterSetterRepository";
|
import { ShuttleGetterSetterRepository } from "../repositories/ShuttleGetterSetterRepository";
|
||||||
|
import { InMemoryNotificationRepository } from "../repositories/InMemoryNotificationRepository";
|
||||||
|
|
||||||
export interface InterchangeSystemBuilderArguments {
|
export interface InterchangeSystemBuilderArguments {
|
||||||
name: string;
|
name: string;
|
||||||
@@ -35,15 +36,14 @@ export class InterchangeSystem {
|
|||||||
* Construct an instance of the class where all composited
|
* Construct an instance of the class where all composited
|
||||||
* classes are correctly linked.
|
* classes are correctly linked.
|
||||||
* @param args
|
* @param args
|
||||||
* @param notificationRepository
|
|
||||||
*/
|
*/
|
||||||
static build(
|
static buildForTesting(
|
||||||
args: InterchangeSystemBuilderArguments,
|
args: InterchangeSystemBuilderArguments,
|
||||||
notificationRepository: NotificationRepository = new RedisNotificationRepository()
|
|
||||||
) {
|
) {
|
||||||
const shuttleRepository = new UnoptimizedInMemoryShuttleRepository();
|
const shuttleRepository = new UnoptimizedInMemoryShuttleRepository();
|
||||||
const shuttleDataLoader = new TimedApiBasedShuttleRepositoryLoader(args.passioSystemId, shuttleRepository);
|
const shuttleDataLoader = new TimedApiBasedShuttleRepositoryLoader(args.passioSystemId, shuttleRepository);
|
||||||
|
|
||||||
|
const notificationRepository = new InMemoryNotificationRepository();
|
||||||
const notificationScheduler = new ETANotificationScheduler(shuttleRepository, notificationRepository);
|
const notificationScheduler = new ETANotificationScheduler(shuttleRepository, notificationRepository);
|
||||||
|
|
||||||
return new InterchangeSystem(
|
return new InterchangeSystem(
|
||||||
|
|||||||
@@ -24,9 +24,8 @@ const systemInfoForTesting = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export function buildSystemForTesting() {
|
export function buildSystemForTesting() {
|
||||||
return InterchangeSystem.build(
|
return InterchangeSystem.buildForTesting(
|
||||||
systemInfoForTesting,
|
systemInfoForTesting,
|
||||||
new InMemoryNotificationRepository()
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user