unit uTiendaWebController_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, uCustomEditor,
  uTiendaWebController, uBizTiendaWeb;

type
  // Test methods for class TClientesController
  
  TestTTiendaWebController = class(TTestCase)
  strict private
    FTiendaWebController: ITiendaWebController;
    FTiendaWeb : IBizTiendaWeb;
  public
    procedure SetUp; override;
    procedure TearDown; override;

  published
    procedure TestActualizarTienda;
    procedure TestDescargarPedidos;
  end;

implementation

uses
  schTiendaWebClient_Intf, uDADataTable, uDataModuleUsuarios,
  SysUtils, Dialogs, uIDataModuleTiendaWeb,
  uDataModuleTiendaWeb, uTiendaWebViewRegister, uHostMainForm,
  uClientesController, uBizContactos;

{ TestTTiendaWebController }

procedure TestTTiendaWebController.SetUp;
begin
  inherited;
  FTiendaWebController := TTiendaWebController.Create;
  FTiendaWeb := FTiendaWebController.Buscar(dmUsuarios.IDEmpresaActual);
end;

procedure TestTTiendaWebController.TearDown;
begin
  inherited;
  FTiendaWebController := NIL;
  FTiendaWeb := NIL;
end;

procedure TestTTiendaWebController.TestActualizarTienda;
begin
  FTiendaWebController.ActualizarTienda(FTiendaWeb);
end;

procedure TestTTiendaWebController.TestDescargarPedidos;
begin
  FTiendaWebController.DescargarPedidos(FTiendaWeb);
end;

initialization
  // Register any test cases with the test runner
  RegisterTest(TestTTiendaWebController.Suite);
end.

