Ejemplo n.º 1
0
        public void CreateUserSpellingListDirectory_TestArgumentPathToLongException()
        {
            // Assign
            string dirPath = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +
                             "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +
                             "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +
                             "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +
                             "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +
                             "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +
                             "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +
                             "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +
                             "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +
                             "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +
                             "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +
                             "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +
                             "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +
                             "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +
                             "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +
                             "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +
                             "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +
                             "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +
                             "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +
                             "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +
                             "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +
                             "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";

            ;
            var dirName = SpellingPropertiesClass.GetArt2MSpellDirectoryName;

            SpellingPropertiesClass.UserName = "******";

            // Act
            var retVal = DirectoryFileOperations.CreateUserSpellingListDirectory(dirPath);


            // Assert
            Assert.IsFalse(retVal);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Read users names list from file.
        /// </summary>
        /// <created>art2m,5/20/2019</created>
        /// <changed>art2m,5/20/2019</changed>
        private void ReadUserFileFillListBox()
        {
            var dirPath = DirectoryFileOperations.CheckExistsCreateArt2MSpellPathDirectory();

            if (string.IsNullOrEmpty(dirPath))
            {
                return;
            }

            var filePath = DirectoryFileOperations.CreatePathToUserFile(dirPath);

            if (string.IsNullOrEmpty(filePath))
            {
                return;
            }

            if (!SpellingReadWriteClass.ReadUserNameFile(filePath))
            {
                return;
            }

            this.FillListBoxWithUserNames();
        }
Ejemplo n.º 3
0
        private string GetUsersSpellingListDirectoryPath()
        {
            var dirPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
            var dirName = SpellingPropertiesClass.GetArt2MSpellDirectoryName;

            var pathArt2MSpell = DirectoryFileOperations.CombineStringsMakeDirectoryPath(dirPath, dirName);

            if (string.IsNullOrEmpty(pathArt2MSpell))
            {
                return(string.Empty);
            }

            var userName = SpellingPropertiesClass.UserName;

            var userDirPath = DirectoryFileOperations.CombineStringsMakeDirectoryPath(pathArt2MSpell, userName);

            if (string.IsNullOrEmpty(userDirPath))
            {
                return(string.Empty);
            }

            return(userDirPath);
        }
Ejemplo n.º 4
0
        /// <summary>
        ///     Add new users name to theAr2mSpell User List file.
        /// </summary>
        /// <created>art2m,5/17/2019</created>
        /// <changed>art2m,5/17/2019</changed>
        private static void AddNewUserToUserNameFile()
        {
            MyMessages.NameOfMethod = MethodBase.GetCurrentMethod().Name;

            var unc = new UsersNameCollection();

            if (unc.ContainsItem(SpellingPropertiesClass.UserName))
            {
                MyMessages.InformationMessage = "This user all ready exists.";
                MyMessages.ShowInformationMessageBox();
            }

            unc.AddItem(SpellingPropertiesClass.UserName);

            var dirPath = DirectoryFileOperations.CheckDirectoryPathExistsCreate();

            var filePath = DirectoryFileOperations.CreateUserSpellingListDirectory(dirPath);


            SpellingReadWriteClass.WriteUserNameFile();

            MyMessages.ErrorMessage = "Unable to create user directory.";
            MyMessages.ShowErrorMessageBox();
        }
Ejemplo n.º 5
0
        public void CreateUserSpellingListDirectoryTest()
        {
            // Assign
            var dirPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
            var dirName = SpellingPropertiesClass.GetArt2MSpellDirectoryName;

            var dirArt2MSpell = DirectoryFileOperations.CombineStringsMakeDirectoryPath(dirPath, dirName);

            dirName = SpellingPropertiesClass.UserName;

            dirPath = Path.Combine(dirPath, dirName);

            if (!Directory.Exists(dirPath))
            {
                Directory.CreateDirectory(dirPath);
            }

            return(Directory.Exists(dirPath));

            // Act

            // Assert
            Assert.Fail();
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Display all of the users spelling list in the list box.
 /// </summary>
 /// <created>art2m,5/22/2019</created>
 /// <changed>art2m,5/22/2019</changed>
 private void DisplayUsersSpellingList()
 {
     var dirPath  = DirectoryFileOperations.CheckExistsCreateArt2MSpellPathDirectory();
     var filePath = DirectoryFileOperations.CreateUserSpellingListDirectory(dirPath);
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Display all of the users spelling list in the list box.
 /// </summary>
 /// <created>art2m,5/22/2019</created>
 /// <changed>art2m,5/22/2019</changed>
 private void DisplayUsersSpellingList()
 {
     var dirPath = DirectoryFileOperations.CheckDirectoryPathExistsCreate();
 }