Test files don't contain "lines".
Yes, yes, I know - you can read and write lines, so obviously they do contain them. But in practice, they don't - they contain a stream of characters some of which are interpreted as a "newline" by software reading the file. When you "read a line", the software reads each character until it gets to the next newline character (in C#, you can see this as '\n') and it returns all the characters it read as a single string - the "line". When you write a line, your text is written to the string and a newline character appended to that.
That's important to know, because it means you can't just "delete a line" or "insert a line" into a text file. To do that you have to create a new file.
To Delete a line:
1) Copy all the text up to the start of the line from the old file to the new file.
2) Find the end of the line to delete without copying it.
3) Copy all the text up to the end of the file from the old file to the new file.
4) Close both files.
5) Delete the original file, and rename the new file to become the old one.
To Insert a line:
1) Copy all the text up to the start of the line before which you want to insert the new line from the old file to the new file.
2) Write your new text to the new file, with a newline character at the end.
3) Copy all the text up to the end of the file from the old file to the new file.
4) Close both files.
5) Delete the original file, and rename the new file to become the old one.