Пример #1
0
        public void t15_Parse_Three_Associated_Classes()
        {
            // [a]-[b]-[c]
            var tokens = TokenStreamBuilder.CombineTokenStreams(
                TokenStreamBuilder.Class("a"),
                TokenStreamBuilder.PureAssociation("-"),
                TokenStreamBuilder.Class("b"),
                TokenStreamBuilder.PureAssociation("-"),
                TokenStreamBuilder.Class("c")
                );

            var cd = new ClassDiagramParser(tokens).ParseClassDiagram();

            Assert.IsNotNull(cd, "class diagram1 parse error");
            Assert.AreEqual(3, cd.Classes.Count(), "wrong class count");
            Assert.AreEqual(2, cd.Associations.Count(), "wrong association count");
            // TODO more tests...
        }