1
0
mirror of https://github.com/bpatrik/pigallery2.git synced 2025-07-15 01:24:25 +02:00

bixing tests

This commit is contained in:
Patrik J. Braun
2018-11-24 14:51:47 +01:00
parent 930c1a2933
commit 8ef3d7d0b6
3 changed files with 40 additions and 7 deletions

View File

@ -9,6 +9,7 @@ import * as path from 'path';
import {OrientationTypes} from 'ts-exif-parser';
import {DirectoryEntity} from '../../../../../backend/model/sql/enitites/DirectoryEntity';
import {Utils} from '../../../../../common/Utils';
import {VideoEntity, VideoMetadataEntity} from '../../../../../backend/model/sql/enitites/VideoEntity';
export class TestHelper {
@ -65,6 +66,28 @@ export class TestHelper {
return d;
}
public static getVideoEntry(dir: DirectoryEntity) {
const sd = new MediaDimensionEntity();
sd.height = 200;
sd.width = 200;
const m = new VideoMetadataEntity();
m.keywords = null;
m.size = sd;
m.creationDate = Date.now();
m.fileSize = 123456789;
m.duration = 10000;
m.bitRate = 4000;
const d = new VideoEntity();
d.name = 'test video.jpg';
d.directory = dir;
d.metadata = m;
return d;
}
public static getPhotoEntry1(dir: DirectoryEntity) {
const p = TestHelper.getPhotoEntry(dir);
@ -75,6 +98,12 @@ export class TestHelper {
return p;
}
public static getVideoEntry1(dir: DirectoryEntity) {
const p = TestHelper.getVideoEntry(dir);
p.name = 'swVideo';
return p;
}
public static getPhotoEntry2(dir: DirectoryEntity) {
const p = TestHelper.getPhotoEntry(dir);