// TODO: Below mentioned form of ToXml and ToString may not be suitable
        // if we want to create one xml/string for entire document

        /// <summary>
        /// Construct xml representation of document (current transaction set
        /// along with header segments)
        /// </summary>
        /// <returns></returns>
        public XElement ToXml()
        {
            ILogger logger = LoggerFactory.Logger;

            XElement ediXml = RootFragment.ToXml();

            return(ediXml);
        }
        /// <summary>
        /// Construct EDI representation of document (current transaction set
        /// along with header segments)
        /// </summary>
        /// <param name="ediDelimiters"></param>
        /// <returns></returns>
        public string ToEDI(Delimiters ediDelimiters)
        {
            ILogger logger = LoggerFactory.Logger;

            string ediDocument = RootFragment.ToEDI(ediDelimiters, false);

            return(ediDocument);
        }
        public void TitleTest()
        {
            var    target = new RootFragment();
            string actual;

            actual = target.Title;
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
        public void SetTitleTest()
        {
            var    target = new RootFragment();
            string title  = string.Empty;

            target.SetTitle(title);
            Assert.Inconclusive("A method that does not return a value cannot be verified.");
        }
        public void FragmentTypeTest()
        {
            var          target = new RootFragment();
            OperatorType actual;

            actual = target.OperatorType;
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
Example #6
0
        public void MatrixConstructorTest()
        {
            var root   = new RootFragment();
            var target = new Matrix(root);

            Assert.NotNull(target.Lifelines);
            Assert.IsInstanceOf(typeof(LifelineCollection), target.Lifelines);
            Assert.AreEqual(0, target.Lifelines.Count);

            Assert.NotNull(target.Rows);
            Assert.IsInstanceOf(typeof(RowsCollection), target.Rows);
            Assert.AreEqual(0, target.Rows.Count);

            Assert.AreEqual(root, target.Root);
            Assert.IsInstanceOf(typeof(RootFragment), target.Root);
        }
Example #7
0
        /// <summary>
        /// Conveniently parse a string to a sequence diagram.
        /// </summary>
        /// <param name="text">The text to parse.</param>
        /// <param name="errors"></param>
        /// <returns>A sequence diagram parsed from the text. Never null.</returns>
        public static ISequenceDiagram CreateFrom(string text, ModelErrorsCollection errors)
        {
            var root    = new RootFragment();
            var matrix  = new Matrix(root);
            var builder = new MatrixBuilder(matrix, errors);

            using (var scanner = new Scanner(text))
            {
                var parser = new Parser(scanner, new StatementParserFactory());
                foreach (Statement statement in parser.Parse())
                {
                    try
                    {
                        statement.Build(builder);
                    }
                    catch (NotImplementedException)
                    {
                    }
                }
                builder.Flush();
            }
            return(matrix);
        }
        public void RootFragmentConstructorTest()
        {
            var target = new RootFragment();

            Assert.Inconclusive("TODO: Implement code to verify target");
        }