public void Read_populates_title_from_root_element_text()
        {
            var    assembly = typeof(MindmapReaderTests).GetTypeInfo().Assembly;
            Stream resource = assembly.GetManifestResourceStream("FlashcardGenerator.Tests.Data.mindmap.mm");

            Assert.IsNotNull(resource);

            var sut  = new MindmapReader(resource);
            var deck = sut.Read();

            Assert.AreEqual("root", deck.Title);
        }
        public void Read_populates_cards_in_tree()
        {
            var    assembly = typeof(MindmapReaderTests).GetTypeInfo().Assembly;
            Stream resource = assembly.GetManifestResourceStream("FlashcardGenerator.Tests.Data.mindmap.mm");

            Assert.IsNotNull(resource);

            var sut   = new MindmapReader(resource);
            var deck  = sut.Read();
            var cards = deck.Definitions;

            Assert.AreEqual(2, cards.Count);
            Assert.AreEqual("term1: def1:more", cards[0].FullText);
            Assert.AreEqual("def1:more", cards[0].Description);
            Assert.AreEqual("term2: def2", cards[1].FullText);

            Assert.AreEqual("term1-1: def1-1", cards[0].Subdefinitions[0].FullText);
            Assert.AreEqual("term2-1: def2-1", cards[1].Subdefinitions[0].FullText);
            Assert.AreEqual("term1-2: def1-2", cards[0].Subdefinitions[1].FullText);
            Assert.AreEqual("term1-1-1:def1-1-1", cards[0].Subdefinitions[0].Subdefinitions[0].FullText);
        }
        public void Export_properly_formatted_document_string()
        {
            var    assembly = typeof(MindmapReaderTests).GetTypeInfo().Assembly;
            Stream resource = assembly.GetManifestResourceStream("FlashcardGenerator.Tests.Data.mindmap.mm");

            Assert.IsNotNull(resource);

            var reader  = new MindmapReader(resource);
            var outline = reader.Read();

            var sut  = new OutlineTextExporter();
            var text = sut.TextExport(outline);

            Console.WriteLine(text);
            var textLines = text.Split(Environment.NewLine);

            Assert.AreEqual("root", textLines[0]);
            Assert.AreEqual("\tterm1\t\t\tdef1:more", textLines[1]);
            Assert.AreEqual("\t\tterm1-1\t\tdef1-1", textLines[2]);
            Assert.AreEqual("\t\t\tterm1-1-1\tdef1-1-1", textLines[3]);
            Assert.AreEqual(3, outline.MaxDepth);
        }