public void TextBlockToTheMiddle() { var pool = new TextBlockPool(); var tb = new TextBlock("hello my name is simon"); pool.SaveTextBlock(tb); var tbr = new TextBlockPointer(tb.Hash, 6, 8); string text = pool.GetTextByLink(tbr); Assert.AreEqual("my", text); }
public void StoreATextBlockAndRetrieveIt() { var pool = new TextBlockPool(); var tb = new TextBlock("hello my name is simon"); pool.SaveTextBlock(tb); TextBlock retrivedBlock; Assert.IsTrue(pool.GetTextBlock(tb.Hash, out retrivedBlock), "Fail to retrieve block by hash"); Assert.AreEqual("hello my name is simon", retrivedBlock.Text); }
public void CreateEDL() { var pool = new TextBlockPool(); TextBlock helloMyName = new TextBlock("hello my name"); pool.SaveTextBlock(helloMyName); TextBlock isSimon = new TextBlock(" is simon"); pool.SaveTextBlock(isSimon); var edl = new EDL(); edl.Add(helloMyName); edl.Add(isSimon); Assert.AreEqual("hello my name is simon", edl.GetText(pool)); }