Esempio n. 1
0
        public void MoveFileTest()
        {
            var destFile = RandomData.GenerateRandomFileName();
            var tempFile = RandomData.GenerateTempFile(this._fileLength);

            FileHelper.MoveFile(tempFile, destFile);
        }
        public void GenerateRandomFileNameWithPathTest()
        {
            var stringValue = RandomData.GenerateRandomFileName(
                Environment.GetFolderPath(
                    Environment.SpecialFolder.ApplicationData,
                    Environment.SpecialFolderOption.DoNotVerify));

            Assert.IsNotNull(stringValue);
        }
        public void GenerateRandomFileNameWithExtTest()
        {
            var stringValue = RandomData.GenerateRandomFileName(fileNameLength: 10, extension: FileExtension);

            Assert.IsNotNull(stringValue);

            Assert.IsTrue(new FileInfo(stringValue).Name.Length == 10 + FileExtension.Length + 1);

            Assert.IsTrue(stringValue.EndsWith(FileExtension));
        }
Esempio n. 4
0
        public void GenerateRandomFileNameAllParamsTest()
        {
            var stringValue = RandomData.GenerateRandomFileName(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData, Environment.SpecialFolderOption.DoNotVerify), fileNameLength: 10, extension: FileExtension);

            Assert.IsNotNull(stringValue);

            Assert.IsTrue(new FileInfo(stringValue).Name.Length == 10 + FileExtension.Length + 1);

            Assert.IsTrue(stringValue.EndsWith(FileExtension));
        }
Esempio n. 5
0
        public void GenerateRandomFileNameWithExtTest()
        {
            const string extension = "dotnettips";

            var stringValue = RandomData.GenerateRandomFileName(fileNameLength: 10, extension: extension);

            Assert.IsNotNull(stringValue);

            Assert.IsTrue(new FileInfo(stringValue).Name.Length == 10 + extension.Length + 1);

            Assert.IsTrue(stringValue.EndsWith(extension));
        }
        public void GenerateRandomFileNameTest()
        {
            var stringValue = RandomData.GenerateRandomFileName();

            Assert.IsNotNull(stringValue);
        }
Esempio n. 7
0
        public void FileHasInvalidCharsTest()
        {
            var destFile = RandomData.GenerateRandomFileName();

            base.Consumer.Consume(FileHelper.FileHasInvalidChars(destFile));
        }
Esempio n. 8
0
        public void GenerateRandomFileNameWithPathTest()
        {
            var stringValue = RandomData.GenerateRandomFileName(@"c:\temp");

            Assert.IsNotNull(stringValue);
        }