VSoftTechnologies/DUnitX

Problemas with TStringLIst instantiation

Closed this issue · 1 comments

Good afternoon, I am new to DUNITX and perhaps I'm getting confused about something. But I can't understand why a memory access error occurs when I try to instantiate an object from a DUNITX test. When I debug within the constructor when it is called from the test, the constructor parameters have the correct values, but for some reason the attribute (in this case FNombres, which is a TStringList) is not accessible.

This is not understandable because it is a private attribute of the class itself and we are within the constructor of that class. The program works and everything is instantiated correctly, but in the tests, I can't understand this behavior. I have tried to create the TStringList and then Assign it to FNombres, but it doesn't work either.

Instantiation inside the test:

...
FCreador_Plantillas.Create(FCreadorNombres.Nombres, auxlist,
    Fparser.CBs_TJLAuto, Fparser.IMGs_TJLAuto, Fparser.Textos_TJLAuto,
    FConfigLoader.DiccionarioValores);
...

Constructor in the class:

TCreador_TJL = class
  private
    FPlantillas: TDictionary<String, TStringList>;
    FNombres, FObjetos_variables: TStringList;
...
public
constructor TCreador_TJL.Create(nombres: TStringList; TJLFile: TStringList;
  CBs: TList<TCB_TJLAuto>; IMGs: TList<TIMG_TJLAuto>;
  TXTs: TList<TTexto_TJLAuto>; valores_grupos: TDictionary < String,
  TDictionary < String, String >> );
begin
  FNombres := nombres; //FNombres inaccessible value!!
...

My error, no problem with that.