adscripcion,categoria,edificio
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import { Controller, Get } from '@nestjs/common';
|
||||
import { AdscripcionService } from './adscripcion.service';
|
||||
|
||||
@Controller('adscripcion')
|
||||
export class AdscripcionController {
|
||||
constructor(private readonly adscripcionService: AdscripcionService) {}
|
||||
|
||||
@Get()
|
||||
findAll() {
|
||||
return this.adscripcionService.findAll();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { Adscripcion } from './entities/adscripcion.entity';
|
||||
|
||||
@Injectable()
|
||||
export class AdscripcionService {
|
||||
constructor(
|
||||
@InjectRepository(Adscripcion)
|
||||
private adscripcionRepository: Repository<Adscripcion>,
|
||||
) {}
|
||||
|
||||
async findAll(): Promise<Adscripcion[]> {
|
||||
return this.adscripcionRepository.find();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
import { AdscripcionController } from './adscripcion.controller'; // Asumiendo que el controlador se llama EdificioController
|
||||
|
||||
describe('EdificioController', () => {
|
||||
let controller: AdscripcionController;
|
||||
|
||||
beforeEach(async () => {
|
||||
const module: TestingModule = await Test.createTestingModule({
|
||||
controllers: [AdscripcionController],
|
||||
}).compile();
|
||||
|
||||
controller = module.get<AdscripcionController>(AdscripcionController);
|
||||
});
|
||||
|
||||
it('should be defined', () => {
|
||||
expect(controller).toBeDefined();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,18 @@
|
||||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
import { AdscripcionService } from './adscripcion.service'; // Asegúrate de importar el servicio correcto
|
||||
|
||||
describe('EdificioService', () => {
|
||||
let service: AdscripcionService;
|
||||
|
||||
beforeEach(async () => {
|
||||
const module: TestingModule = await Test.createTestingModule({
|
||||
providers: [AdscripcionService], // Asegúrate de incluir el servicio correcto aquí
|
||||
}).compile();
|
||||
|
||||
service = module.get<AdscripcionService>(AdscripcionService);
|
||||
});
|
||||
|
||||
it('should be defined', () => {
|
||||
expect(service).toBeDefined();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,12 @@
|
||||
import { Controller, Get } from '@nestjs/common';
|
||||
import { CategoriaService } from './categoria.service';
|
||||
|
||||
@Controller('categoria')
|
||||
export class CategoriaController {
|
||||
constructor(private readonly categoriaService: CategoriaService) {}
|
||||
|
||||
@Get()
|
||||
findAll() {
|
||||
return this.categoriaService.findAll();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { Categoria } from './entities/categoria.entity';
|
||||
|
||||
@Injectable()
|
||||
export class CategoriaService {
|
||||
constructor(
|
||||
@InjectRepository(Categoria)
|
||||
private categoriaRepository: Repository<Categoria>,
|
||||
) {}
|
||||
|
||||
async findAll(): Promise<Categoria[]> {
|
||||
return this.categoriaRepository.find();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
import { CategoriaController } from './categiria.controller'; // Asumiendo que el controlador se llama EdificioController
|
||||
|
||||
describe('EdificioController', () => {
|
||||
let controller: CategoriaController;
|
||||
|
||||
beforeEach(async () => {
|
||||
const module: TestingModule = await Test.createTestingModule({
|
||||
controllers: [CategoriaController],
|
||||
}).compile();
|
||||
|
||||
controller = module.get<CategoriaController>(CategoriaController);
|
||||
});
|
||||
|
||||
it('should be defined', () => {
|
||||
expect(controller).toBeDefined();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,18 @@
|
||||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
import { CategoriaService } from './categoria.service'; // Asegúrate de importar el servicio correcto
|
||||
|
||||
describe('EdificioService', () => {
|
||||
let service: CategoriaService;
|
||||
|
||||
beforeEach(async () => {
|
||||
const module: TestingModule = await Test.createTestingModule({
|
||||
providers: [CategoriaService], // Asegúrate de incluir el servicio correcto aquí
|
||||
}).compile();
|
||||
|
||||
service = module.get<CategoriaService>(CategoriaService);
|
||||
});
|
||||
|
||||
it('should be defined', () => {
|
||||
expect(service).toBeDefined();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,18 @@
|
||||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
import { EdificioController } from './edificio.controller'; // Asumiendo que el controlador se llama EdificioController
|
||||
|
||||
describe('EdificioController', () => {
|
||||
let controller: EdificioController;
|
||||
|
||||
beforeEach(async () => {
|
||||
const module: TestingModule = await Test.createTestingModule({
|
||||
controllers: [EdificioController],
|
||||
}).compile();
|
||||
|
||||
controller = module.get<EdificioController>(EdificioController);
|
||||
});
|
||||
|
||||
it('should be defined', () => {
|
||||
expect(controller).toBeDefined();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,12 @@
|
||||
import { Controller, Get } from '@nestjs/common';
|
||||
import { EdificioService } from './edificio.service';
|
||||
|
||||
@Controller('categoria')
|
||||
export class EdificioController {
|
||||
constructor(private readonly edificioService: EdificioService) {}
|
||||
|
||||
@Get()
|
||||
findAll() {
|
||||
return this.edificioService.findAll();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
import { EdificioService } from './edificio.service'; // Asegúrate de importar el servicio correcto
|
||||
|
||||
describe('EdificioService', () => {
|
||||
let service: EdificioService;
|
||||
|
||||
beforeEach(async () => {
|
||||
const module: TestingModule = await Test.createTestingModule({
|
||||
providers: [EdificioService], // Asegúrate de incluir el servicio correcto aquí
|
||||
}).compile();
|
||||
|
||||
service = module.get<EdificioService>(EdificioService);
|
||||
});
|
||||
|
||||
it('should be defined', () => {
|
||||
expect(service).toBeDefined();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,16 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { Edificio } from './entities/edificio.entity';
|
||||
|
||||
@Injectable()
|
||||
export class EdificioService {
|
||||
constructor(
|
||||
@InjectRepository(Edificio)
|
||||
private categoriaRepository: Repository<Edificio>,
|
||||
) {}
|
||||
|
||||
async findAll(): Promise<Edificio[]> {
|
||||
return this.categoriaRepository.find();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user