2 using System.Collections.Generic;
3 using System.ComponentModel;
9 using System.Text.RegularExpressions;
10 using System.Web.Script.Serialization;
12 namespace Sage.
ES.S50.UnitTest.Tools
17 public static partial class FunctionsUnitTest
19 private static string _cPantalla =
string.Empty;
27 public static void _ImportXMLToDataTable(
string tcXmlFile, ref DataTable tdtDataTable, out
string tcErrorMessage)
31 if (!File.Exists(tcXmlFile))
33 tcErrorMessage =
"El fichero '" + tcXmlFile +
"' no existe.";
39 using (DataSet ds =
new DataSet())
41 ds.ReadXml(tcXmlFile);
43 if (ds != null && ds.Tables.Count > 0)
44 tdtDataTable = ds.Tables[0].Copy();
47 catch (Exception loEx)
49 tcErrorMessage = loEx.Message;
58 public static string _GetXmlFolderMockTest(List<string> tlsMetodosExcluidos)
62 if (tlsMetodosExcluidos == null)
63 tlsMetodosExcluidos =
new List<string>();
67 StackTrace stackTrace =
new StackTrace();
68 StackFrame[] loSt = stackTrace.GetFrames();
69 IEnumerable<StackFrame> loStUnitTest = loSt.AsEnumerable().Where(l => l.GetMethod().Module.Name ==
"Sage.ES.S50.UnitTest.dll" && !tlsMetodosExcluidos.Contains(l.GetMethod().Name));
70 lcFolder = loStUnitTest.FirstOrDefault().GetMethod().Name;
78 public static string _GetXmlFolderMockTest()
80 return _GetXmlFolderMockTest(null);
86 public static string _Pantalla
89 set => _cPantalla = value;
97 public static string PathXML()
99 return PathXML(_Pantalla);
108 public static string PathXML(
string tcPantalla)
110 string lcPathMockXml =
"XML";
115 lcPathMockXml =
@"Mock\addons\factucert\140\XML";
119 lcPathMockXml =
@"Mock\addons\factucert\240\XML";
123 return Path.Combine(Directory.GetCurrentDirectory(), lcPathMockXml);