Reseting a StreamReader leads to strange behaviour. The first assert succeeds whereas the second fails. To correct it one (bad) solution consists in reseting to position 3 instead of 0: sr.BaseStream.Position = 3;
using (var sr = new StreamReader(@"c:\temp\test.txt", Encoding.UTF8)) // test.txt is encoded in UTF8
{
var read = sr.ReadLine();
Assert.AreEqual("fromfile", read); // ok
sr.BaseStream.Position = 0;
sr.DiscardBufferedData();
read = sr.ReadLine();
Assert.AreEqual("fromfile", read); //fails
}