mirror of
https://gitlab.com/mobicoop/v3/service/matcher.git
synced 2026-01-01 08:22:41 +00:00
functional ad insert
This commit is contained in:
@@ -4,25 +4,25 @@ import { Coordinates } from '@modules/geography/core/domain/value-objects/coordi
|
||||
describe('Waypoint value object', () => {
|
||||
it('should create a waypoint value object', () => {
|
||||
const coordinatesVO = new Coordinates({
|
||||
lon: 48.689445,
|
||||
lat: 6.17651,
|
||||
lat: 48.689445,
|
||||
lon: 6.17651,
|
||||
});
|
||||
expect(coordinatesVO.lon).toBe(48.689445);
|
||||
expect(coordinatesVO.lat).toBe(6.17651);
|
||||
expect(coordinatesVO.lat).toBe(48.689445);
|
||||
expect(coordinatesVO.lon).toBe(6.17651);
|
||||
});
|
||||
it('should throw an exception if longitude is invalid', () => {
|
||||
try {
|
||||
new Coordinates({
|
||||
lon: 348.689445,
|
||||
lat: 6.17651,
|
||||
lat: 48.689445,
|
||||
lon: 186.17651,
|
||||
});
|
||||
} catch (e: any) {
|
||||
expect(e).toBeInstanceOf(ArgumentOutOfRangeException);
|
||||
}
|
||||
try {
|
||||
new Coordinates({
|
||||
lon: -348.689445,
|
||||
lat: 6.17651,
|
||||
lat: 48.689445,
|
||||
lon: -186.17651,
|
||||
});
|
||||
} catch (e: any) {
|
||||
expect(e).toBeInstanceOf(ArgumentOutOfRangeException);
|
||||
@@ -31,16 +31,16 @@ describe('Waypoint value object', () => {
|
||||
it('should throw an exception if latitude is invalid', () => {
|
||||
try {
|
||||
new Coordinates({
|
||||
lon: 48.689445,
|
||||
lat: 96.17651,
|
||||
lat: 148.689445,
|
||||
lon: 6.17651,
|
||||
});
|
||||
} catch (e: any) {
|
||||
expect(e).toBeInstanceOf(ArgumentOutOfRangeException);
|
||||
}
|
||||
try {
|
||||
new Coordinates({
|
||||
lon: 48.689445,
|
||||
lat: -96.17651,
|
||||
lat: -148.689445,
|
||||
lon: 6.17651,
|
||||
});
|
||||
} catch (e: any) {
|
||||
expect(e).toBeInstanceOf(ArgumentOutOfRangeException);
|
||||
|
||||
@@ -8,13 +8,13 @@ import { Test, TestingModule } from '@nestjs/testing';
|
||||
|
||||
const originWaypoint: Waypoint = {
|
||||
position: 0,
|
||||
lon: 48.689445,
|
||||
lat: 6.17651,
|
||||
lat: 48.689445,
|
||||
lon: 6.17651,
|
||||
};
|
||||
const destinationWaypoint: Waypoint = {
|
||||
position: 1,
|
||||
lon: 48.8566,
|
||||
lat: 2.3522,
|
||||
lat: 48.8566,
|
||||
lon: 2.3522,
|
||||
};
|
||||
|
||||
const mockGeorouter: GeorouterPort = {
|
||||
|
||||
@@ -9,12 +9,12 @@ import {
|
||||
} from '@modules/geography/core/domain/route.types';
|
||||
|
||||
const originCoordinates: Coordinates = {
|
||||
lon: 48.689445,
|
||||
lat: 6.17651,
|
||||
lat: 48.689445,
|
||||
lon: 6.17651,
|
||||
};
|
||||
const destinationCoordinates: Coordinates = {
|
||||
lon: 48.8566,
|
||||
lat: 2.3522,
|
||||
lat: 48.8566,
|
||||
lon: 2.3522,
|
||||
};
|
||||
const additionalCoordinates: Coordinates = {
|
||||
lon: 48.7566,
|
||||
|
||||
@@ -7,21 +7,21 @@ import { SpacetimePoint } from '@modules/geography/core/domain/value-objects/spa
|
||||
describe('Timepoint value object', () => {
|
||||
it('should create a timepoint value object', () => {
|
||||
const timepointVO = new SpacetimePoint({
|
||||
lon: 48.689445,
|
||||
lat: 6.17651,
|
||||
lat: 48.689445,
|
||||
lon: 6.17651,
|
||||
duration: 150,
|
||||
distance: 12000,
|
||||
});
|
||||
expect(timepointVO.duration).toBe(150);
|
||||
expect(timepointVO.distance).toBe(12000);
|
||||
expect(timepointVO.lon).toBe(48.689445);
|
||||
expect(timepointVO.lat).toBe(6.17651);
|
||||
expect(timepointVO.lat).toBe(48.689445);
|
||||
expect(timepointVO.lon).toBe(6.17651);
|
||||
});
|
||||
it('should throw an exception if longitude is invalid', () => {
|
||||
try {
|
||||
new SpacetimePoint({
|
||||
lon: 348.689445,
|
||||
lat: 6.17651,
|
||||
lat: 48.689445,
|
||||
lon: 186.17651,
|
||||
duration: 150,
|
||||
distance: 12000,
|
||||
});
|
||||
@@ -30,8 +30,8 @@ describe('Timepoint value object', () => {
|
||||
}
|
||||
try {
|
||||
new SpacetimePoint({
|
||||
lon: -348.689445,
|
||||
lat: 6.17651,
|
||||
lon: 48.689445,
|
||||
lat: -186.17651,
|
||||
duration: 150,
|
||||
distance: 12000,
|
||||
});
|
||||
@@ -42,8 +42,8 @@ describe('Timepoint value object', () => {
|
||||
it('should throw an exception if latitude is invalid', () => {
|
||||
try {
|
||||
new SpacetimePoint({
|
||||
lon: 48.689445,
|
||||
lat: 96.17651,
|
||||
lat: 248.689445,
|
||||
lon: 6.17651,
|
||||
duration: 150,
|
||||
distance: 12000,
|
||||
});
|
||||
@@ -52,8 +52,8 @@ describe('Timepoint value object', () => {
|
||||
}
|
||||
try {
|
||||
new SpacetimePoint({
|
||||
lon: 48.689445,
|
||||
lat: -96.17651,
|
||||
lon: -148.689445,
|
||||
lat: 6.17651,
|
||||
duration: 150,
|
||||
distance: 12000,
|
||||
});
|
||||
@@ -64,8 +64,8 @@ describe('Timepoint value object', () => {
|
||||
it('should throw an exception if distance is invalid', () => {
|
||||
try {
|
||||
new SpacetimePoint({
|
||||
lon: 48.689445,
|
||||
lat: 6.17651,
|
||||
lat: 48.689445,
|
||||
lon: 6.17651,
|
||||
duration: 150,
|
||||
distance: -12000,
|
||||
});
|
||||
@@ -76,8 +76,8 @@ describe('Timepoint value object', () => {
|
||||
it('should throw an exception if duration is invalid', () => {
|
||||
try {
|
||||
new SpacetimePoint({
|
||||
lon: 48.689445,
|
||||
lat: 6.17651,
|
||||
lat: 48.689445,
|
||||
lon: 6.17651,
|
||||
duration: -150,
|
||||
distance: 12000,
|
||||
});
|
||||
|
||||
@@ -8,19 +8,19 @@ describe('Waypoint value object', () => {
|
||||
it('should create a waypoint value object', () => {
|
||||
const waypointVO = new Waypoint({
|
||||
position: 0,
|
||||
lon: 48.689445,
|
||||
lat: 6.17651,
|
||||
lat: 48.689445,
|
||||
lon: 6.17651,
|
||||
});
|
||||
expect(waypointVO.position).toBe(0);
|
||||
expect(waypointVO.lon).toBe(48.689445);
|
||||
expect(waypointVO.lat).toBe(6.17651);
|
||||
expect(waypointVO.lat).toBe(48.689445);
|
||||
expect(waypointVO.lon).toBe(6.17651);
|
||||
});
|
||||
it('should throw an exception if position is invalid', () => {
|
||||
try {
|
||||
new Waypoint({
|
||||
position: -1,
|
||||
lon: 48.689445,
|
||||
lat: 6.17651,
|
||||
lat: 48.689445,
|
||||
lon: 6.17651,
|
||||
});
|
||||
} catch (e: any) {
|
||||
expect(e).toBeInstanceOf(ArgumentInvalidException);
|
||||
@@ -30,8 +30,8 @@ describe('Waypoint value object', () => {
|
||||
try {
|
||||
new Waypoint({
|
||||
position: 0,
|
||||
lon: 348.689445,
|
||||
lat: 6.17651,
|
||||
lat: 48.689445,
|
||||
lon: 186.17651,
|
||||
});
|
||||
} catch (e: any) {
|
||||
expect(e).toBeInstanceOf(ArgumentOutOfRangeException);
|
||||
@@ -39,8 +39,8 @@ describe('Waypoint value object', () => {
|
||||
try {
|
||||
new Waypoint({
|
||||
position: 0,
|
||||
lon: -348.689445,
|
||||
lat: 6.17651,
|
||||
lat: 48.689445,
|
||||
lon: -186.17651,
|
||||
});
|
||||
} catch (e: any) {
|
||||
expect(e).toBeInstanceOf(ArgumentOutOfRangeException);
|
||||
@@ -50,8 +50,8 @@ describe('Waypoint value object', () => {
|
||||
try {
|
||||
new Waypoint({
|
||||
position: 0,
|
||||
lon: 48.689445,
|
||||
lat: 96.17651,
|
||||
lat: 148.689445,
|
||||
lon: 6.17651,
|
||||
});
|
||||
} catch (e: any) {
|
||||
expect(e).toBeInstanceOf(ArgumentOutOfRangeException);
|
||||
@@ -59,8 +59,8 @@ describe('Waypoint value object', () => {
|
||||
try {
|
||||
new Waypoint({
|
||||
position: 0,
|
||||
lon: 48.689445,
|
||||
lat: -96.17651,
|
||||
lat: -148.689445,
|
||||
lon: 6.17651,
|
||||
});
|
||||
} catch (e: any) {
|
||||
expect(e).toBeInstanceOf(ArgumentOutOfRangeException);
|
||||
|
||||
@@ -52,13 +52,13 @@ describe('Get Basic Route Controller', () => {
|
||||
waypoints: [
|
||||
{
|
||||
position: 0,
|
||||
lon: 48.689445,
|
||||
lat: 6.17651,
|
||||
lat: 48.689445,
|
||||
lon: 6.17651,
|
||||
},
|
||||
{
|
||||
position: 1,
|
||||
lon: 48.8566,
|
||||
lat: 2.3522,
|
||||
lat: 48.8566,
|
||||
lon: 2.3522,
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user