diff --git a/src/application/tests/example.test.ts b/src/application/tests/example.test.ts index e0fa0f4..6129e89 100644 --- a/src/application/tests/example.test.ts +++ b/src/application/tests/example.test.ts @@ -2,9 +2,17 @@ import { ExampleTestUsecases } from '@core/example/usecases/example.test.usecases'; import { expect } from 'chai'; -describe('test usecase -> test action', () => { +describe('test usecase -> test validator action', () => { it('should return ok:true', async () => { - const result = await ExampleTestUsecases.testAction(); + const result = await ExampleTestUsecases.testValidatorAction(); expect(result['ok']).to.be.true; }); -}); \ No newline at end of file +}); + +describe('test usecase -> test database repositories action', () => { + it('should return ok:true', async () => { + const result = await ExampleTestUsecases.testDatabaseRepositoriesAction(); + expect(result['ok']).to.be.true; + }); +}); + diff --git a/src/core/example/usecases/example.test.usecases.ts b/src/core/example/usecases/example.test.usecases.ts index 9c1e533..0f34276 100644 --- a/src/core/example/usecases/example.test.usecases.ts +++ b/src/core/example/usecases/example.test.usecases.ts @@ -21,9 +21,10 @@ import { Example } from '../models/example'; */ export class ExampleTestUsecases extends UseCases { + /** - * Test action example to test some services - * @date 20/09/2021 - 08:00:00 + * Test the validator service + * @date 22/10/2021 - 16:44:59 * @author cecric * * @public @@ -31,13 +32,26 @@ export class ExampleTestUsecases extends UseCases { * @async * @returns {Promise} */ - public static async testAction (): Promise { + public static async testValidatorAction (): Promise { const ex = new Example(); ex.setExample('sample@example.fr'); ex.setDateExample(new Date()); const validatorService: ValidatorService = await ServiceManager.get(ValidatorService.name); await validatorService.validate('example', ex.toObject()); - logger.log('test something'); + return {'ok': true}; + } + + /** + * Test the orm services + * @date 20/09/2021 - 08:00:00 + * @author cecric + * + * @public + * @static + * @async + * @returns {Promise} + */ + public static async testDatabaseRepositoriesAction (): Promise { const repositoriesService: RepositoriesService = await ServiceManager.get(RepositoriesService.name); const repo = await repositoriesService.getRepositoryByName('example') as IExample; const result = await repo.getExample();