mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 07:50:31 +00:00
add integration test setup for parking data
This commit is contained in:
33
src/loaders/parking/loadParkingTestData.ts
Normal file
33
src/loaders/parking/loadParkingTestData.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import { ParkingGetterSetterRepository } from "../../repositories/ParkingGetterSetterRepository";
|
||||
import { IParkingStructure } from "../../entities/ParkingRepositoryEntities";
|
||||
|
||||
const parkingStructures: IParkingStructure[] = [
|
||||
{
|
||||
address: "300 E Walnut, Orange, CA 92867",
|
||||
capacity: 871,
|
||||
spotsAvailable: 211,
|
||||
coordinates: {
|
||||
latitude: 33.7945513,
|
||||
longitude: -117.8518707,
|
||||
},
|
||||
name: "Anderson Structure",
|
||||
id: "1",
|
||||
},
|
||||
{
|
||||
address: "200 W Sycamore Ave, Orange, CA 92866-1053",
|
||||
capacity: 692,
|
||||
spotsAvailable: 282,
|
||||
coordinates: {
|
||||
latitude: 33.792937,
|
||||
longitude: -117.854782
|
||||
},
|
||||
name: "Barrera",
|
||||
id: "2",
|
||||
}
|
||||
];
|
||||
|
||||
export async function loadParkingTestData(repository: ParkingGetterSetterRepository) {
|
||||
await Promise.all(parkingStructures.map(async structure => {
|
||||
await repository.addOrUpdateParkingStructure(structure);
|
||||
}))
|
||||
}
|
||||
@@ -1,15 +1,7 @@
|
||||
// Mock data
|
||||
import { IEta, IOrderedStop, IRoute, IShuttle, IStop } from "../../entities/ShuttleRepositoryEntities";
|
||||
import { ShuttleGetterSetterRepository } from "../../repositories/ShuttleGetterSetterRepository";
|
||||
import { InterchangeSystemBuilderArguments } from "../../entities/InterchangeSystem";
|
||||
|
||||
export const supportedIntegrationTestSystems: InterchangeSystemBuilderArguments[] = [
|
||||
{
|
||||
id: "1",
|
||||
name: "Chapman University",
|
||||
passioSystemId: "263",
|
||||
},
|
||||
];
|
||||
import { supportedIntegrationTestSystems } from "../supportedIntegrationTestSystems";
|
||||
|
||||
const redRoutePolylineCoordinates = [
|
||||
{
|
||||
|
||||
11
src/loaders/supportedIntegrationTestSystems.ts
Normal file
11
src/loaders/supportedIntegrationTestSystems.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { InterchangeSystemBuilderArguments } from "../entities/InterchangeSystem";
|
||||
import { ChapmanApiBasedParkingRepositoryLoader } from "./parking/ChapmanApiBasedParkingRepositoryLoader";
|
||||
|
||||
export const supportedIntegrationTestSystems: InterchangeSystemBuilderArguments[] = [
|
||||
{
|
||||
id: "1",
|
||||
name: "Chapman University",
|
||||
passioSystemId: "263",
|
||||
parkingSystemId: ChapmanApiBasedParkingRepositoryLoader.id,
|
||||
},
|
||||
];
|
||||
Reference in New Issue
Block a user