import { expect } from 'chai';
import { getApp, dateHash } from '../../fixtures/env';

describe('MicroService', () => {
    const entityName = `Student_` + dateHash();
    const entityName2 = `Student_` + dateHash() + 2;

    it('addEntity(name: string)', async () => {
        const app = await getApp();

        const entity = await app.firstMicroService.addEntity(entityName);

        expect(app.firstMicroService.data.entities).includes(entity);
    });

    it('addEntity(name: string)', async () => {
        const app = await getApp();

        const entity = await app.firstMicroService.addEntity(entityName);

        expect(app.firstMicroService.data.entities).includes(entity);
    });

    it('removeEntity(name: string)', async () => {
        const app = await getApp();

        const entity = await app.firstMicroService.removeEntity(entityName);

        expect(app.firstMicroService.data.entities).not.includes(entity);
    });
});
