179 lines
4.1 KiB
ObjectPascal
179 lines
4.1 KiB
ObjectPascal
unit uEmpresasController_Test;
|
|
{
|
|
|
|
Delphi DUnit Test Case
|
|
----------------------
|
|
This unit contains a skeleton test case class generated by the Test Case Wizard.
|
|
Modify the generated code to correctly setup and call the methods from the unit
|
|
being tested.
|
|
|
|
}
|
|
|
|
interface
|
|
|
|
uses
|
|
TestFramework, Classes, uEmpresasController, Contnrs, SysUtils, uIDataModuleEmpresas,
|
|
Forms, Windows, Controls, uBizEmpresas;
|
|
type
|
|
// Test methods for class TEmpresasController
|
|
|
|
TestTEmpresasController = class(TTestCase)
|
|
strict private
|
|
FEmpresasController: TEmpresasController;
|
|
public
|
|
procedure SetUp; override;
|
|
procedure TearDown; override;
|
|
published
|
|
procedure TestEliminar;
|
|
procedure TestEliminar1;
|
|
procedure TestGuardar;
|
|
procedure TestDescartarCambios;
|
|
procedure TestExiste;
|
|
procedure TestAnadir;
|
|
procedure TestBuscar;
|
|
procedure TestBuscarTodos;
|
|
procedure TestNuevo;
|
|
procedure TestVer;
|
|
procedure TestVerTodos;
|
|
procedure TestToStringList;
|
|
end;
|
|
|
|
implementation
|
|
|
|
procedure TestTEmpresasController.SetUp;
|
|
begin
|
|
FEmpresasController := TEmpresasController.Create;
|
|
end;
|
|
|
|
procedure TestTEmpresasController.TearDown;
|
|
begin
|
|
FEmpresasController.Free;
|
|
FEmpresasController := nil;
|
|
end;
|
|
|
|
procedure TestTEmpresasController.TestEliminar;
|
|
var
|
|
ID: Integer;
|
|
begin
|
|
Check(False);
|
|
// TODO: Setup method call parameters
|
|
FEmpresasController.Eliminar(ID);
|
|
// TODO: Validate method results
|
|
end;
|
|
|
|
procedure TestTEmpresasController.TestEliminar1;
|
|
var
|
|
AEmpresa: IBizEmpresa;
|
|
begin
|
|
Check(False);
|
|
// TODO: Setup method call parameters
|
|
FEmpresasController.Eliminar(AEmpresa);
|
|
// TODO: Validate method results
|
|
end;
|
|
|
|
procedure TestTEmpresasController.TestGuardar;
|
|
var
|
|
AEmpresa: IBizEmpresa;
|
|
begin
|
|
Check(False);
|
|
// TODO: Setup method call parameters
|
|
FEmpresasController.Guardar(AEmpresa);
|
|
// TODO: Validate method results
|
|
end;
|
|
|
|
procedure TestTEmpresasController.TestDescartarCambios;
|
|
var
|
|
AEmpresa: IBizEmpresa;
|
|
begin
|
|
Check(False);
|
|
// TODO: Setup method call parameters
|
|
FEmpresasController.DescartarCambios(AEmpresa);
|
|
// TODO: Validate method results
|
|
end;
|
|
|
|
procedure TestTEmpresasController.TestExiste;
|
|
var
|
|
ReturnValue: Boolean;
|
|
ID: Integer;
|
|
begin
|
|
Check(False);
|
|
// TODO: Setup method call parameters
|
|
ReturnValue := FEmpresasController.Existe(ID);
|
|
// TODO: Validate method results
|
|
end;
|
|
|
|
procedure TestTEmpresasController.TestAnadir;
|
|
var
|
|
AEmpresa: IBizEmpresa;
|
|
begin
|
|
Check(False);
|
|
// TODO: Setup method call parameters
|
|
FEmpresasController.Anadir(AEmpresa);
|
|
// TODO: Validate method results
|
|
end;
|
|
|
|
procedure TestTEmpresasController.TestBuscar;
|
|
var
|
|
ReturnValue: IBizEmpresa;
|
|
ID: Integer;
|
|
begin
|
|
Check(False);
|
|
// TODO: Setup method call parameters
|
|
ReturnValue := FEmpresasController.Buscar(ID);
|
|
// TODO: Validate method results
|
|
end;
|
|
|
|
procedure TestTEmpresasController.TestBuscarTodos;
|
|
var
|
|
ReturnValue: IBizEmpresa;
|
|
begin
|
|
ReturnValue := FEmpresasController.BuscarTodos;
|
|
// TODO: Validate method results
|
|
end;
|
|
|
|
procedure TestTEmpresasController.TestNuevo;
|
|
var
|
|
ReturnValue: IBizEmpresa;
|
|
begin
|
|
Check(False);
|
|
ReturnValue := FEmpresasController.Nuevo;
|
|
// TODO: Validate method results
|
|
end;
|
|
|
|
procedure TestTEmpresasController.TestVer;
|
|
var
|
|
AEmpresa: IBizEmpresa;
|
|
begin
|
|
Check(False);
|
|
// TODO: Setup method call parameters
|
|
FEmpresasController.Ver(AEmpresa);
|
|
// TODO: Validate method results
|
|
end;
|
|
|
|
procedure TestTEmpresasController.TestVerTodos;
|
|
var
|
|
AEmpresas: IBizEmpresa;
|
|
begin
|
|
Check(False);
|
|
// TODO: Setup method call parameters
|
|
FEmpresasController.VerTodos(AEmpresas);
|
|
// TODO: Validate method results
|
|
end;
|
|
|
|
procedure TestTEmpresasController.TestToStringList;
|
|
var
|
|
ReturnValue: TStringList;
|
|
AEmpresa: IBizEmpresa;
|
|
begin
|
|
Check(False);
|
|
// TODO: Setup method call parameters
|
|
ReturnValue := FEmpresasController.ToStringList(AEmpresa);
|
|
// TODO: Validate method results
|
|
end;
|
|
|
|
initialization
|
|
// Register any test cases with the test runner
|
|
RegisterTest(TestTEmpresasController.Suite);
|
|
end.
|
|
|