3 using Microsoft.VisualStudio.TestTools.UnitTesting;
5 using System.Collections.Generic;
10 using Newtonsoft.Json.Linq;
11 using static System.Net.WebRequestMethods;
13 namespace Sage.
ES.S50.UnitTest.addons.idatos
19 [DeploymentItem(
@"Idatos\",
"Idatos")]
20 public class CuentaPresupuestariaTest
23 private TestContext testContextInstance;
29 public TestContext TestContext
33 return testContextInstance;
37 testContextInstance = value;
42 #region Additional test attributes 48 public static void MyClassInitialize(TestContext testContext)
51 testContext.__Test_LoadRandomConfig();
56 [Owner(Owners.Luisa_Galvan), TestMethod()]
58 public void CrearCuentaPresupuestaria_IdatosTest()
62 DataTable ldtCuentas =
new DataTable();
64 ldtCuentas.Columns.Add(
"codigo", typeof(
string));
65 ldtCuentas.Columns.Add(
"nombre", typeof(
string));
67 DataRow ldr = ldtCuentas.NewRow();
68 ldr[
"codigo"] =
"44440001";
69 ldr[
"nombre"] =
"presupuestaria 01";
70 ldtCuentas.Rows.Add(ldr);
72 ldr = ldtCuentas.NewRow();
73 ldr[
"codigo"] =
"00000002";
74 ldr[
"nombre"] =
"presupuestaria 02";
75 ldtCuentas.Rows.Add(ldr);
77 ldr = ldtCuentas.NewRow();
79 ldr[
"nombre"] =
"presupuestaria 04";
80 ldtCuentas.Rows.Add(ldr);
82 ldr = ldtCuentas.NewRow();
84 ldr[
"nombre"] =
"presupuestaria 05";
85 ldtCuentas.Rows.Add(ldr);
87 ldr = ldtCuentas.NewRow();
89 ldr[
"nombre"] =
"presupuestaria 06";
90 ldtCuentas.Rows.Add(ldr);
94 DataTable ldtReferencias =
new DataTable();
95 ldtReferencias.Clear();
96 ldtReferencias.Columns.Add(
"idtabla", typeof(
int));
97 ldtReferencias.Columns.Add(
"cuenta", typeof(
string));
98 ldtReferencias.Columns.Add(
"referencia", typeof(
string));
99 ldtReferencias.Columns.Add(
"filaCSV", typeof(
int));
104 PrivateObject importacionPO =
new PrivateObject(loCuentaPresup);
107 pt.SetStaticFieldOrProperty(
"dtCuentaRef", ldtReferencias);
109 importacionPO.SetFieldOrProperty(
"dtAuxCuentas", ldtCuentas);
117 Assert.IsFalse(
false,
"No se han creado registro en tabla" + e.Message);
120 Assert.IsTrue(
true,
"Ha pasado el test unitario");
string CrearCuentaPresupuestaria(int fila, string ctaPresup)