public void ArchivoNuevoVacio() { Archivo arch = new Archivo(); Assert.IsTrue(arch.DocumentoActual != null); Assert.IsTrue(string.IsNullOrEmpty(arch.DocumentoActual.Text)); }
public void ArchivosDiferentes3() { Archivo arch1 = new Archivo(); object arch2 = new object(); arch1.DocumentoActual.Text = "hola"; arch1.Ubicacion = Path.Combine(Path.GetTempPath(), "prueba1.gar"); Assert.IsFalse(arch1.Equals(arch2)); }
public void ArchivosIguales() { Archivo arch1 = new Archivo(); Archivo arch2 = new Archivo(); arch1.DocumentoActual.Text = "hola"; arch2.DocumentoActual.Text = "hola"; arch1.Ubicacion = Path.Combine(Path.GetTempPath(), "prueba.gar"); arch2.Ubicacion = Path.Combine(Path.GetTempPath(), "prueba.gar"); Assert.IsTrue(arch1.Equals(arch2)); }
public void NombreVacioCorrecto() { Archivo arch1 = new Archivo(); Assert.IsTrue(arch1.Nombre.Equals(string.Empty)); }
public void NombreCorrecto() { string filename = Path.GetRandomFileName(); Archivo arch1 = new Archivo(); arch1.Ubicacion = Path.Combine(Path.GetTempPath(), filename); Assert.IsTrue(arch1.Nombre.Equals(filename)); }
public void TemplateAsignadoCorrecto() { Archivo arch1 = new Archivo(); arch1.AsignarTemplate(); Assert.IsTrue(arch1.DocumentoActual.Text.Equals(Archivo.TEMPLATE)); }
public void New() { bool permitirNuevo = true; if (!ArchivoActual.TextoActualGuardado) { permitirNuevo = servicioMessageBox.ShowMessageWithOptions("Esta seguro?", "hola"); } if (permitirNuevo) { ArchivoActual = new Archivo(); ListaMensajesCompilacion.Clear(); RaisePropertyChanged("CompilacionCorrecta"); } }
public MainViewModel(IMessageBoxService servMsgBox, IFileManagerDialogService servFileManager, IProcessStarterService servProcess, IPrinterService servImpr) { ////if (IsInDesignMode) ////{ //// // Code runs in Blend --> create design time data. ////} ////else ////{ //// // Code runs "for real" ////} ArchivoActual = new Archivo(); ListaMensajesCompilacion = new ObservableCollection<MensajeCompilacion>(); CommandNew = new RelayCommand(New); CommandOpen = new RelayCommand(Open); CommandSave = new RelayCommand(Save); CommandSaveAs = new RelayCommand(SaveAs); CommandPrint = new RelayCommand(Print); CommandExit = new RelayCommand(Exit); CommandCompilar = new RelayCommand(Compilar); CommandEjecutar = new RelayCommand(Ejecutar); CommandAbrirManual = new RelayCommand(AbrirManual); CommandAboutUs = new RelayCommand(AboutUs); servicioMessageBox = servMsgBox; servicioFileManager = servFileManager; servicioImpresion = servImpr; servicioProcesos = servProcess; compilador = new Compilador(); }
public void ImpresionNulleada() { Archivo arch = new Archivo(); arch.Ubicacion = Path.Combine(Path.GetTempPath(), Path.GetTempFileName()); arch.DocumentoActual.Text = "que tal buenos dias"; MainViewModel vm = new MainViewModel(null, null, null, ArmarPrinterChooserService(null, arch.Nombre, arch.DocumentoActual.Text).Object); vm.Print(); }
static internal Archivo AbrirDeDisco(string path) { Archivo arch = null; if (File.Exists(path)) { using (StreamReader strReader = File.OpenText(path)) { arch = new Archivo(); arch.DocumentoActual.Text = strReader.ReadToEnd(); arch.Ubicacion = path; } } return arch; }
public object Clone() { Archivo arch = new Archivo(); arch.DocumentoActual = new TextDocument(); arch.DocumentoActual.Text = DocumentoActual.Text; arch.Ubicacion = Ubicacion; return arch; }