public void TestAddEmpleado() { //Declaro test de tipo BDEmpleado para poder invocar el "AddEmpleado(Empleado theEmpleado)" answer = BDEmpleado.AddEmpleado(theEmpleado); //answer obtiene true si se inserta el empleado Assert.IsTrue(answer); }
/// <summary> /// Metodo para agregar un empleado. /// </summary> /// <param name="empleado">objeto que representa el empleado a agregar</param> /// <returns>true si fue agregado</returns> public bool AddNewEmpleado(Empleado empleado) { Logger.EscribirInfo(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name, LogicaM10Resources.MensajeInicioInfoLogger, System.Reflection.MethodBase.GetCurrentMethod().Name); try { return(BDEmpleado.AddEmpleado(empleado)); } catch (ArgumentNullException ex) { Logger.EscribirError(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name, ex); throw new ExcepcionesTangerine.M10.NullArgumentException(LogicaM10Resources.Codigo, LogicaM10Resources.Mensaje, ex); } catch (SqlException ex) { Logger.EscribirError(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name, ex); throw new ExcepcionesTangerine.ExceptionTGConBD(LogicaM10Resources.Codigo, LogicaM10Resources.Mensaje, ex); } catch (FormatException ex) { Logger.EscribirError(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name, ex); throw new ExcepcionesTangerine.M10.WrongFormatException(LogicaM10Resources.Codigo_Error_Formato, LogicaM10Resources.Mensaje_Error_Formato, ex); } catch (ExcepcionesTangerine.ExceptionTGConBD ex) { Logger.EscribirError(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name, ex); throw ex; } catch (Exception ex) { Logger.EscribirError(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name, ex); throw new ExcepcionesTangerine.ExceptionsTangerine(LogicaM10Resources.Mensaje_Generico_Error, ex); } }