I'm currently working on a project where I'm parsing an external file to an abstracted object like so:
public interface IMapConverter
{
IMap Convert(IMapFile file);
}
public interface IMapFile
{
void Load(string filePath);
string Json { get; }
}
My plan was to abstract the loading of the file by using the IMapFile implementation and creating the StreamReader inside that implementation. I would then pass that on to the IMapConverter.Convert method. Would that be a correct approach and maintain testability? Would it for example be wrong to pass the string directly to the IMapConverter and handle it there?
Aucun commentaire:
Enregistrer un commentaire