public void t08_Parse_ClassDiagram_Containing_Two_Associated_Classes_With_Multiplicities_Numbers(string sourceFrom, string sourceTo, string targetFrom, string targetTo)
        {
            var tokens = new ClassDiagramTokenStream();

            tokens.AddRange(TokenStreamBuilder.Class("a"));

            tokens.AddRange(new[] { sourceFrom.Token() });
            if (sourceTo != null)
            {
                tokens.AddRange(new[] { "..".Token(), sourceTo.Token() });
            }

            tokens.AddRange(new[] { TokenType.Dash.Token() });

            tokens.AddRange(new[] { targetFrom.Token() });
            if (targetTo != null)
            {
                tokens.AddRange(new[] { "..".Token(), targetTo.Token() });
            }

            tokens.AddRange(TokenStreamBuilder.Class("b"));

            var parser = new ClassDiagramParser(tokens);
            var cd     = parser.ParseClassDiagram();
            var assoc  = t08_check(cd);

            checkMultiplicityKind(assoc.SourceMultiplicity.FromKind, sourceFrom, "source from");
            checkMultiplicityKind(assoc.SourceMultiplicity.ToKind, sourceTo, "source to");
            checkMultiplicityKind(assoc.TargetMultiplicity.FromKind, targetFrom, "target from");
            checkMultiplicityKind(assoc.TargetMultiplicity.ToKind, targetTo, "target to");

            Assert.AreEqual(sourceFrom, assoc.SourceMultiplicity.From, "source wrong value");
            Assert.AreEqual(targetFrom, assoc.TargetMultiplicity.From, "target wrong value");
        }
        public static ClassDiagramTokenStream Association(string sourceFrom, string sourceTo, string association, string targetFrom, string targetTo)
        {
            var tokens = new ClassDiagramTokenStream();

            tokens.AddRange(new[] { sourceFrom.Token() });
            if (sourceTo != null)
            {
                tokens.AddRange(new[] { "..".Token(), sourceTo.Token() });
            }

            tokens.AddRange(PureAssociation(association));

            tokens.AddRange(new[] { targetFrom.Token() });
            if (targetTo != null)
            {
                tokens.AddRange(new[] { "..".Token(), targetTo.Token() });
            }

            return(tokens);
        }
        public static ClassDiagramTokenStream CombineTokenStreams(params ClassDiagramTokenStream[] streams)
        {
            var combinedStream = new ClassDiagramTokenStream();

            foreach (var singleStream in streams)
            {
                if (singleStream != null)
                {
                    combinedStream.AddRange(singleStream);
                }
            }
            return(combinedStream);
        }