public void AddExtension_ExtensionIncluded() { using (var dlg = new DummyOpenFileDialogLinux()) { dlg.AddExtension = true; Assert.AreEqual(m_File.FullPath, dlg.CalGetCurrentFileName(m_File.FullPath)); } }
public void AddExtension_CheckFileExists_NoFilter() { using (var dlg = new DummyOpenFileDialogLinux()) { dlg.AddExtension = true; dlg.CheckFileExists = true; dlg.DefaultExt = "txt"; Assert.AreEqual(m_File.FullPath, dlg.CalGetCurrentFileName(m_File.FullPathNoExtension)); } }
public void AddExtension_CheckFileExists_MultipleExtensions() { using (var dlg = new DummyOpenFileDialogLinux()) { dlg.AddExtension = true; dlg.CheckFileExists = true; dlg.DefaultExt = "foo"; dlg.Filter = "Other files|*.bla|Text files|*.foo;*.txt"; dlg.FilterIndex = 2; Assert.AreEqual(m_File.FullPath, dlg.CalGetCurrentFileName(m_File.FullPathNoExtension)); } }
public void AddExtension_NoCheckFileExists_WithFilter() { using (var dlg = new DummyOpenFileDialogLinux()) { dlg.AddExtension = true; dlg.CheckFileExists = false; dlg.DefaultExt = "foo"; dlg.Filter = "Other files|*.bla|Text files|*.abc;*.txt"; dlg.FilterIndex = 2; Assert.AreEqual(Path.ChangeExtension(m_File.FullPath, "abc"), dlg.CalGetCurrentFileName(m_File.FullPathNoExtension)); } }
public void AddExtension_ExtensionIncluded() { using (var dlg = new DummyOpenFileDialogLinux()) { dlg.AddExtension = true; Assert.AreEqual(m_File.FullPath, dlg.CalGetCurrentFileName(m_File.FullPath)); } }
public void AddExtension_NoCheckFileExists_WithFilter() { using (var dlg = new DummyOpenFileDialogLinux()) { dlg.AddExtension = true; dlg.CheckFileExists = false; dlg.DefaultExt = "foo"; dlg.Filter = "Other files|*.bla|Text files|*.abc;*.txt"; dlg.FilterIndex = 2; Assert.AreEqual(Path.ChangeExtension(m_File.FullPath, "abc"), dlg.CalGetCurrentFileName(m_File.FullPathNoExtension)); } }
public void AddExtension_NoCheckFileExists_NoFilter() { using (var dlg = new DummyOpenFileDialogLinux()) { dlg.AddExtension = true; dlg.CheckFileExists = false; dlg.DefaultExt = "foo"; Assert.AreEqual(Path.ChangeExtension(m_File.FullPath, "foo"), dlg.CalGetCurrentFileName(m_File.FullPathNoExtension)); } }
public void AddExtension_CheckFileExists_MultipleExtensions() { using (var dlg = new DummyOpenFileDialogLinux()) { dlg.AddExtension = true; dlg.CheckFileExists = true; dlg.DefaultExt = "foo"; dlg.Filter = "Other files|*.bla|Text files|*.foo;*.txt"; dlg.FilterIndex = 2; Assert.AreEqual(m_File.FullPath, dlg.CalGetCurrentFileName(m_File.FullPathNoExtension)); } }