Example #1
0
        public void Write_Create_ANewFile_When_Using_IncrementFileExtension_Option([Range(1, 101)] int i)
        {
            // Arrange
            var testFile = new FileObject($"{TestFile.FilePathOnly}incrementTest");

            testFile.CreateOrTruncate(false);

            var newFileName = $"{testFile.FilePathOnly}{testFile.FileNameOnlyNoExtension}.{i}";

            // Act
            testFile.Write($"File #{i}", FileOption.IncrementFileExtensionIfExist, Encoding.ASCII);

            // Assert
            Assert.That(FileExists(newFileName), Is.True);
        }