public void CursorPositionFixer_PostSingleCRLF_ReturnsSamePosition() { var initialCursorPosition = 3; var fixer = new CursorPositionFixer(); var fixedCursorPosition = fixer.Fix( file: CRLFEndingFile(), cursorPosition: initialCursorPosition); var realCursorPosition = 3; Assert.AreEqual(realCursorPosition, fixedCursorPosition); }
public void CursorPositionFixer_PreCRLF_ReturnsSamePositionMinusOne() { var initialCursorPosition = 1; var fixer = new CursorPositionFixer(); var fixedCursorPosition = fixer.Fix( file: CRLFEndingFile(), cursorPosition: initialCursorPosition); var realCursorPosition = initialCursorPosition - 1; Assert.AreEqual(realCursorPosition, fixedCursorPosition); }
public void CursorPositionFixer_PostMultipleCRLF_ReturnsPositionPlusCRMinusOne() { var initialCursorPosition = 10; var fixer = new CursorPositionFixer(); var fixedCursorPosition = fixer.Fix( file: CRLFEndingFile(), cursorPosition: initialCursorPosition); var realCursorPosition = 12; Assert.AreEqual(realCursorPosition, fixedCursorPosition); }
public void CursorPositionFixer_WithMissingFile_ReturnsSamePosition() { var initialCursorPosition = 1; var fixer = new CursorPositionFixer(); var fixedCursorPosition = fixer.Fix( file: @"C:\missing.file", cursorPosition: initialCursorPosition); Assert.AreEqual(initialCursorPosition, fixedCursorPosition); }