Exemplo n.º 1
0
        public void TestGuardarTextoSinPermisos()
        {
            texto = new Texto();
            string filePath = Environment.GetFolderPath(Environment.SpecialFolder.Windows) +
                              "\\TestGuardarTextoSinPermisos.txt";

            string dataToBeSaved = "this cannot be saved";

            texto.Guardar(filePath, dataToBeSaved);
        }
Exemplo n.º 2
0
        public static bool Guardar(Jornada jornada)
        {
            try{
                Texto t = new Archivos.Texto();

                return(t.Guardar(Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory) + "\\jornada.txt", jornada.ToString()));
            } catch (Exception e)
            {
                throw new ArchivosException(e);
            }
        }
Exemplo n.º 3
0
        public void TestMethod3()
        {
            //arrange
            string ruta;
            Alumno a = new Alumno(1, "nicolas", "gonzalez", "12344543", EntidadesAbstractas.Persona.ENacionalidad.Argentino, Universidad.EClases.Legislacion);

            //act

            Archivos.Texto texto = new Archivos.Texto();
            ruta = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
            texto.Guardar(ruta, a.ToString());

            //asert lo maneja expectedexception
        }
Exemplo n.º 4
0
        public void TestLeerYGuardarTextoDatosValidos()
        {
            string filePath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) +
                              "\\TestLeerYGuardarTextoDatosValidos.txt";
            string dataToBeSaved = "this is some data";

            texto = new Texto();
            texto.Guardar(filePath, dataToBeSaved);

            string savedData;

            texto.Leer(filePath, out savedData);

            Assert.AreEqual(savedData, dataToBeSaved);
            File.Delete(filePath);
        }
Exemplo n.º 5
0
        //que onda esto?

        public static bool Guardar(Jornada jornada)
        {
            bool rta = false;

            try {
                string         a         = jornada.ToString();
                Archivos.Texto guardador = new Archivos.Texto();

                if (guardador.Guardar(Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\\Jornada.txt", a))
                {
                    rta = true;
                }
                else
                {
                    rta = false;
                }
            }catch (Exception e)
            {
                throw new ArchivosException(e);
            }


            return(rta);
        }