1 using Microsoft.VisualStudio.TestTools.UnitTesting;
10 namespace Sage.
ES.S50.UnitTest.Docscompra
22 private TestContext testContextInstance;
28 public TestContext TestContext
32 return testContextInstance;
36 testContextInstance = value;
40 #region Atributos de prueba adicionales 50 testContext.__Test_LoadRandomConfig();
52 if (EW_GLOBAL._Empresa == null) EW_GLOBAL._Empresa =
new sage.
ew.
empresa.
Empresa(Convert.ToString(EW_GLOBAL._GetVariable(
"wc_empresa")));
54 _NewCodigo = EW_GLOBAL._Empresa.
_Codigo +
"|" + Convert.ToInt32(DB.Ejercicio_EW) +
"|41000001|FACPRUEBA|1|1";
65 public static string _NewCodigo =
"";
70 public static string _RandomCodigo =
"";
79 string tcProveedor =
"41000001";
80 string tcEmpresa = EW_GLOBAL._Empresa._Codigo;
81 string tcFactura =
"FACPRUEBA";
84 Decimal tnImporte = 10;
85 DateTime tdEmision = DateTime.Now;
86 DateTime tdVencim = DateTime.Now.AddDays(1);
87 string tcMoneda = EW_GLOBAL._Empresa._Moneda;
89 string tcBanco =
string.Empty;
90 string tcVendedor =
string.Empty;
91 string tcFpago =
string.Empty;
92 string tcMandato =
string.Empty;
93 string tcCobrador =
string.Empty;
94 Int32 tnPeriodo = Convert.ToInt32(DB.Ejercicio_EW);
96 _Mantenimiento.
_New(tcProveedor, tcEmpresa, tcFactura, tnOrden, tnPendiente, tnImporte, tdEmision, tdVencim, tcMoneda, tnNum_Banco, tcBanco, tdEmision, tcFpago,
false, tnPeriodo);
100 Assert.Fail(
"No se puede crear una prevision de cobro");
107 [Owner(Owners.JoseA_Sevillano), TestMethod()]
112 _Mantenimiento.__Test_EwMante_Delete(_NewCodigo);
118 [Owner(Owners.JoseA_Sevillano), TestMethod()]
122 DataTable ldtCodCom =
new DataTable();
127 string tcProveedor =
"41000001";
128 string tcEmpresa = EW_GLOBAL._Empresa._Codigo;
129 string tcFactura =
"FACPRUEBA";
132 Decimal tnImporte = 10;
133 DateTime tdEmision = DateTime.Now;
134 DateTime tdVencim = DateTime.Now.AddDays(1);
135 string tcMoneda = EW_GLOBAL._Empresa._Moneda;
137 string tcBanco =
string.Empty;
138 string tcVendedor =
string.Empty;
139 string tcFpago =
string.Empty;
140 string tcMandato =
string.Empty;
141 string tcCobrador =
string.Empty;
142 Boolean llOk =
false;
144 target.
_Codigo = tcEmpresa +
"|" + Convert.ToInt32(DB.Ejercicio_EW) +
"|" + tcProveedor +
"|" + tcFactura +
"|" + tnOrden +
"|1";
156 target.
_Ejercicio = Convert.ToInt32(DB.Ejercicio_EW);
161 Assert.AreEqual(llOk,
true,
"No se ha podido eliminar la prevision de pago");
168 [Owner(Owners.JoseA_Sevillano), TestMethod()]
172 DataTable ldtCodCom =
new DataTable();
177 if (EW_GLOBAL._Empresa == null) EW_GLOBAL._Empresa =
new sage.
ew.
empresa.
Empresa(Convert.ToString(EW_GLOBAL._GetVariable(
"wc_empresa")));
179 string tcProveedor =
"41000001";
180 string tcEmpresa = EW_GLOBAL._Empresa.
_Codigo;
181 string tcFactura =
"FACPRUEBA";
184 Decimal tnImporte = 10;
185 DateTime tdEmision = DateTime.Now;
186 DateTime tdVencim = DateTime.Now.AddDays(1);
187 string tcMoneda = EW_GLOBAL._Empresa._Moneda;
189 string tcBanco =
string.Empty;
190 string tcVendedor =
string.Empty;
191 string tcFpago =
string.Empty;
192 string tcMandato =
string.Empty;
193 string tcCobrador =
string.Empty;
194 Boolean llOk =
false;
196 target.
_Codigo = tcEmpresa +
"|" + Convert.ToInt32(DB.Ejercicio_EW) +
"|" + tcProveedor +
"|" + tcFactura +
"|" + tnOrden +
"|1";
208 target.
_Ejercicio = Convert.ToInt32(DB.Ejercicio_EW);
213 Assert.AreEqual(llOk,
true,
"No se ha podido eliminar la prevision de pago");
220 [Owner(Owners.JoseA_Sevillano), TestMethod()]
224 Boolean llRemoveCuenta =
false;
225 DataTable ldtCodCom =
new DataTable();
233 loCuenta.
_New(
"57200001",
"BANCO");
234 llRemoveCuenta =
true;
237 if (EW_GLOBAL._Empresa == null) EW_GLOBAL._Empresa =
new sage.
ew.
empresa.
Empresa(Convert.ToString(EW_GLOBAL._GetVariable(
"wc_empresa")));
239 string tcProveedor =
"41000001";
240 string tcEmpresa = EW_GLOBAL._Empresa.
_Codigo;
241 string tcFactura =
"FACPRUEBA";
244 Decimal tnImporte = 10;
245 DateTime tdEmision = DateTime.Now;
246 DateTime tdVencim = DateTime.Now.AddDays(1);
247 string tcMoneda = EW_GLOBAL._Empresa._Moneda;
249 string tcBanco =
string.Empty;
250 string tcVendedor =
string.Empty;
251 string tcFpago =
string.Empty;
252 string tcMandato =
string.Empty;
253 string tcCobrador =
string.Empty;
254 Boolean llOkC =
false;
256 target.
_Codigo = tcEmpresa +
"|" + Convert.ToInt32(DB.Ejercicio_EW) +
"|" + tcProveedor +
"|" + tcFactura +
"|" + tnOrden +
"|1";
268 target.
_Ejercicio = Convert.ToInt32(DB.Ejercicio_EW);
270 llOkC = target.
_Contabilizar(
"57200001", DateTime.Now, tnImporte);
271 llOkC = !String.IsNullOrEmpty(target.
_Asi);
280 if (llRemoveCuenta) loCuenta.
_Delete();
282 Assert.AreEqual(llOkC,
true,
"No se ha podido contabilizar la prevision de pago");
Clase de negocio base para mantenimientos
Classe empresa basada en sage.ew.ewmante
void _New(string tcProveedor, string tcEmpresa, string tcFactura, int tnOrden, int tnPendiente, decimal tnImporte, DateTime tdEmision, DateTime tdVencim, string tcMoneda, int tnNum_Banco, string tcBanco, DateTime? tdFecha_Oper, string tcFpago="", bool tlRecc=false, int tnPeriodo=0, decimal tnCambio=1, decimal tnImporteDiv=0, string lcConcepto="")
Crea una nueva previsión de pago a partir de los parámetros indicados y la carga en el objeto...
new int _Ejercicio
Ejercicio
string _Empresa
Código de empresa.
string _Proveedor
Código de proveedor Contable
bool _Contabilizar(string tcBanco, DateTime tdFecha, decimal tnImporteEntrega, Asientos toAsiento=null)
Contabiliza la previsión cargada en el objeto, si el importe cobrado es inferior al de la prevision d...
decimal _ImporteDiv
ImporteDiv
Clase utilizada para realizar asientos contables.
_EstadosMantenimiento _Estado
Estado en que se encuentra el registro
override void _New(string tcCodigo="")
_New
override bool _Save()
Método publico para guardar los datos de la previsión.
virtual bool _Existe_Registro()
Nos indica si existe el registro en la Base de Datos
override string _Codigo
Sobreescribe el metodo _Codigo para cargar la configuración del TPV cuando se estableza el valor del ...
DateTime _Fecha_Vencim
Fecha vencimiento de previsión
Clase para las previsiones de pago de proveedores
override bool _Delete()
Borra la previsión de pago cargada, se realizan controles previos para asegurar que es posible el bor...
void PrevisionPagoContabilizar()
Una prueba de CContabilización /summary>
override string _Codigo
Campo clave del mantenimiento
Clase de negocio del mantenimiento de cuentas contables
virtual string _Codigo
Valor del campo clave que
_EstadosMantenimiento
Declaro un enum para los estados del mantenimiento.
static void MyClassInitialize(TestContext testContext)
string _Factura
Número de factura
void DeleteTest2()
Una prueba de _Delete /summary>
Se trata de una clase de prueba para PrevisionCobroTest y se pretende que contenga todas las pruebas ...
DateTime _Fecha_Emision
Fecha emisión de previsión
void NewTest()
Una prueba de _New /summary>
bool _Delete(bool tlActivarValidaciones)
si se pasa un true al borrar realiza todas la validaciones del borrado como si estuvieras al formular...
string _Divisa
Moneda de la previsión
override bool _Delete()
Elimina el registro actual
void SaveTest()
Una prueba de _Delete /summary>