public void IfTheRequestedFilePosition_IsBeyondTheEndOfTheFile_TheResultIsAsIfTheFileHadBeenExtendedWithCharactersOnItsFinalLine()
        {
            string input = "012\n456\n89";

            var calculator = new FilePositionCalculator(input);

            Assert.That(calculator.FilePosition(10), Is.EqualTo(new FilePosition(3, 3)));
        }
        public void FilePosition_OnFileWithOnlyNewLines_WorksCorrectly(int position, int linenumber, int lineposition)
        {
            string input = "\n\n\n\n\n";

            var calculator = new FilePositionCalculator(input);

            Assert.That(calculator.FilePosition(position), Is.EqualTo(new FilePosition(linenumber, lineposition)));
        }
        public void FilePosition_OnFileWithMixedCharactersAndNewLines_WorksCorrectly(int position, int linenumber, int lineposition)
        {
            string input = "012\n456\n89";

            var calculator = new FilePositionCalculator(input);

            Assert.That(calculator.FilePosition(position), Is.EqualTo(new FilePosition(linenumber, lineposition)));
        }
        public void Lines_AnEmptyString_HasOneLine()
        {
            string input = @"";

            var calculator = new FilePositionCalculator(input);

            Assert.That(calculator.Lines, Is.EqualTo(1));
        }
        public void Lines_ShouldReturnTheNumberOfLines_InATextString()
        {
            string input = @"1 line 1
2 line 2
3 line 3";

            var calculator = new FilePositionCalculator(input);

            Assert.That(calculator.Lines, Is.EqualTo(3));
        }