public void ReadInitialText_MultiLineTagFollowedByText_Empty() { Stream stream = new MemoryStream(Encoding.ASCII.GetBytes( "\\tag\ntext")); SFMReader test = new SFMReader(stream); string token = test.ReadInitialText(); Assert.AreEqual(string.Empty, token); }
public void ReadInitialText_MultiLineTextFollowedByTextAndTag_1stLineAndBeginning2ndLine() { Stream stream = new MemoryStream(Encoding.ASCII.GetBytes( "text\nmore text\\tag")); SFMReader test = new SFMReader(stream); string token = test.ReadInitialText(); Assert.AreEqual("text\nmore text", token); }
public void ReadInitialText_MultiLineTextFollowedByEmpty_1stLine() { Stream stream = new MemoryStream(Encoding.ASCII.GetBytes( "text\n")); SFMReader test = new SFMReader(stream); string token = test.ReadInitialText(); Assert.AreEqual("text\n", token); }
public void ReadInitialText_Empty() { Stream stream = new MemoryStream(Encoding.ASCII.GetBytes( @"")); SFMReader test = new SFMReader(stream); string token = test.ReadInitialText(); Assert.AreEqual("", token); }
public void Offset_After5CharactersOfInitialText_5() { Stream stream = new MemoryStream(Encoding.ASCII.GetBytes( "hello")); SFMReader test = new SFMReader(stream); test.ReadInitialText(); Assert.AreEqual(5, test.Offset); }
public void ReadNextTextThenReadInitialText_Throw() { Stream stream = new MemoryStream(Encoding.ASCII.GetBytes(@"\tag1 some text\tag2")); SFMReader test = new SFMReader(stream); test.ReadNextText(); Assert.Throws <InvalidOperationException>( () => test.ReadInitialText()); }