apihub24_token_authentication/test/right.repository.mock.ts

34 lines
910 B
TypeScript

import { DynamicModule, Global, Module } from "@nestjs/common";
import { IRight } from "../src";
import { IRepository } from "@apihub24/repository";
@Global()
@Module({})
export class RightRepositoryMockModule {
static forRoot(): DynamicModule {
const providers = [
{
provide: "@apihub24/right_repository",
useClass: RightRepositoryMock,
},
];
return {
module: RightRepositoryMockModule,
providers: [...providers],
exports: [...providers],
};
}
}
class RightRepositoryMock implements IRepository<IRight> {
getBy(filter: (model: IRight) => boolean): Promise<IRight[]> {
throw new Error("Method not implemented.");
}
save(models: IRight[]): Promise<IRight[]> {
throw new Error("Method not implemented.");
}
deleteBy(filter: (model: IRight) => boolean): Promise<boolean> {
throw new Error("Method not implemented.");
}
}