public void ReadNextText_MultilineTextStateFollowedByInitialTag_1stLineTextThen2ndLineText() { Stream stream = new MemoryStream(Encoding.ASCII.GetBytes( "\\tag text first\n\\tag more text")); SFMReader test = new SFMReader(stream); Assert.AreEqual("text first\n", test.ReadNextText()); Assert.AreEqual("more text", test.ReadNextText()); }
public void ReadNextText_TextOnly_Null() { Stream stream = new MemoryStream(Encoding.ASCII.GetBytes( @"text first")); SFMReader test = new SFMReader(stream); Assert.IsNull(test.ReadNextText()); }
public void ReadNextText_MultilineEmptyFollowedByTag_Empty() { Stream stream = new MemoryStream(Encoding.ASCII.GetBytes( "\\tag\n\n\\tag")); SFMReader test = new SFMReader(stream); Assert.AreEqual("\n", test.ReadNextText()); }
public void ReadNextText_MultilineTextStateFollowedByEmpty_1stAnd2ndLineText() { Stream stream = new MemoryStream(Encoding.ASCII.GetBytes( "\\tag text first\n")); SFMReader test = new SFMReader(stream); Assert.AreEqual("text first\n", test.ReadNextText()); }
public void ReadNextText_MedialText() { Stream stream = new MemoryStream(Encoding.ASCII.GetBytes( @"\one text first\bf")); SFMReader test = new SFMReader(stream); string token = test.ReadNextText(); Assert.AreEqual("text first", token); }
public void ReadNextText_TagOnly_Empty() { Stream stream = new MemoryStream(Encoding.ASCII.GetBytes( @"\one")); SFMReader test = new SFMReader(stream); string token = test.ReadNextText(); Assert.AreEqual("", token); }
public void Offset_ShoeboxModeAfter4LetterTagWithStarAfterEOF_5() { Stream stream = new MemoryStream(Encoding.ASCII.GetBytes( "\\tag*")); SFMReader test = new SFMReader(stream); test.Mode = SFMReader.ParseMode.Shoebox; test.ReadNextTag(); test.ReadNextText(); Assert.AreEqual(5, test.Offset); }