Exemplo n.º 1
0
        public void BrowseForFilesFactory_with_Defaults_Returns_Folder_Browser_with_Default_Properties()
        {
            Win32Forms.OpenFileDialog dialog = BrowseLibrary.BrowseForFilesFactory();

            Assert.AreEqual("", dialog.DefaultExt);
            Assert.AreEqual("All Files" + "|*.*", dialog.Filter);
            Assert.AreEqual("", dialog.InitialDirectory);
            Assert.AreEqual(false, dialog.Multiselect);
            Assert.AreEqual("Browse for File", dialog.Title);
        }
Exemplo n.º 2
0
        public void BrowseForFilesFactory_with_Multi_Select_Returns_Folder_Browser_with_Valid_Properties()
        {
            string initialDirectory = @"C:\Foo\Bar";
            string fileTypeLabel    = "FooBar Files";
            bool   multiSelect      = true;

            Win32Forms.OpenFileDialog dialog = BrowseLibrary.BrowseForFilesFactory(initialDirectory,
                                                                                   fileTypeLabel,
                                                                                   multiSelect: multiSelect);

            Assert.AreEqual("", dialog.DefaultExt);
            Assert.AreEqual(fileTypeLabel + "|*.*", dialog.Filter);
            Assert.AreEqual(initialDirectory, dialog.InitialDirectory);
            Assert.AreEqual(multiSelect, dialog.Multiselect);
            Assert.AreEqual("Browse for Files", dialog.Title);
        }
Exemplo n.º 3
0
        public void BrowseForFilesFactory_with_Empty_FileTypes_Returns_Folder_Browser_with_Valid_Properties()
        {
            string        initialDirectory = @"C:\Foo\Bar";
            bool          multiselect      = false;
            List <string> fileTypes        = new List <string>()
            {
            };

            Win32Forms.OpenFileDialog dialog = BrowseLibrary.BrowseForFilesFactory(initialDirectory,
                                                                                   "",
                                                                                   fileTypes,
                                                                                   multiselect);

            Assert.AreEqual("", dialog.DefaultExt);
            Assert.AreEqual("All Files" + "|*.*", dialog.Filter);
            Assert.AreEqual(initialDirectory, dialog.InitialDirectory);
            Assert.AreEqual(multiselect, dialog.Multiselect);
            Assert.AreEqual("Browse for File", dialog.Title);
        }