WIP create user
This commit is contained in:
parent
c33a0c8292
commit
393105d525
|
@ -0,0 +1,9 @@
|
||||||
|
import { CreateAdRequest } from '../domain/dtos/create-ad.request';
|
||||||
|
|
||||||
|
export class CreateAdCommand {
|
||||||
|
readonly createAdRequest: CreateAdRequest;
|
||||||
|
|
||||||
|
constructor(request: CreateAdRequest) {
|
||||||
|
this.createAdRequest = request;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
export class CreateAdRequest {}
|
|
@ -1,6 +1,8 @@
|
||||||
import { classes } from '@automapper/classes';
|
import { classes } from '@automapper/classes';
|
||||||
import { AutomapperModule } from '@automapper/nestjs';
|
import { AutomapperModule } from '@automapper/nestjs';
|
||||||
import { Ad } from '../../domain/entities/ad';
|
import { Ad } from '../../domain/entities/ad';
|
||||||
|
import { Test, TestingModule } from '@nestjs/testing';
|
||||||
|
import { CreateAdUseCase } from '../../domain/usecases/create-ad.usecase';
|
||||||
const mockAddress1: Address = {
|
const mockAddress1: Address = {
|
||||||
position: 0,
|
position: 0,
|
||||||
lon: '48.68944505415954',
|
lon: '48.68944505415954',
|
||||||
|
@ -41,7 +43,25 @@ const mockMessager = {
|
||||||
|
|
||||||
describe('CreateAdUseCase', () => {
|
describe('CreateAdUseCase', () => {
|
||||||
it('should be defined', () => {});
|
it('should be defined', () => {});
|
||||||
|
let createAdUseCase: CreateAdUseCase;
|
||||||
|
beforeAll(async () => {
|
||||||
|
const module: TestingModule = await Test.createTestingModule({
|
||||||
|
imports: [],
|
||||||
|
providers: [
|
||||||
|
{
|
||||||
|
provide: AdsRepository,
|
||||||
|
useValue: mockAdRepository,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
provide: Messager,
|
||||||
|
useValue: mockMessager,
|
||||||
|
},
|
||||||
|
CreateAdUseCase,
|
||||||
|
],
|
||||||
|
}).compile();
|
||||||
|
|
||||||
|
createAdUseCase = module.get<CreateAdUseCase>(CreateAdUseCase);
|
||||||
|
});
|
||||||
describe('execution', () => {
|
describe('execution', () => {
|
||||||
it('should create an new ad', () => {});
|
it('should create an new ad', () => {});
|
||||||
it('should throw an error if the ad already exists', () => {});
|
it('should throw an error if the ad already exists', () => {});
|
||||||
|
|
Loading…
Reference in New Issue