예제 #1
0
        public void FirstLiseOfInputReversedAndPlacedToBeLastInOutput()
        {
            FileReverseManager.ReverseContent(_inputFilePath, _outputFilePath);
            var outputLines = File.ReadAllLines(_outputFilePath);

            Assert.AreEqual(outputLines[3], "cba");
        }
예제 #2
0
        public void SecondLastLineOfInputReversedAndCorrectlyPositioned()
        {
            FileReverseManager.ReverseContent(_inputFilePath, _outputFilePath);
            var outputLines = File.ReadAllLines(_outputFilePath);

            Assert.AreEqual(outputLines[1], "ihg");
        }
예제 #3
0
        public void EmptyInputFileGeneratesEmptyOutput()
        {
            FileReverseManager.ReverseContent($"{Directory.GetCurrentDirectory()}\\emptyInput.txt", _outputFilePath);
            Assert.IsTrue(File.Exists(_outputFilePath));

            var lines = File.ReadAllLines(_outputFilePath);

            Assert.AreEqual(lines.Length, 0);
        }
예제 #4
0
 public void InputFileCannotBeFoundNegative()
 {
     FileReverseManager.ReverseContent(@"F:\Users\Public\TestFolder\pathDontExistInputTest.txt", _outputFilePath);
 }
예제 #5
0
 public void InputAndOutputFilesAreEmptyNegative()
 {
     Assert.ThrowsException <ArgumentNullException>(() => FileReverseManager.ReverseContent("", "     "), "File paths must be set");
 }
예제 #6
0
 public void InputAndOutputFilesAreNullNegative()
 {
     FileReverseManager.ReverseContent(null, null);
 }