public void ClassWith2Properties()
        {
            IModel model = Build.Class("Class001").WithProperty("PROP001", "Comment").WithProperty("PROP002", "Comment").Model();
            ModelFormatter formatter = new ModelFormatter(model);

            Assert.That(formatter.Render(), Is.EqualTo("[Class] Class001\r\n  [Property] PROP001 /*...*/\r\n  [Property] PROP002 /*...*/"));
        }
예제 #2
0
        public void ClassWith2BranchesOfPropertiesWithPath()
        {
            IModel model = Build
                           .Class("Class001").With(
                Build.Property("PROP00A", "Comment").WithProperty("PROP0A1", "Comment").WithProperty("PROP0A2", "Comment")
                )
                           .With(
                Build.Property("PROP00B", "Comment").WithProperty("PROP0B1", "Comment").WithProperty("PROP0B2", "Comment")
                ).Model();
            ModelFormatter formatter = new ModelFormatter(model)
            {
                IncludeModelPaths = true
            };

            const string expected = "1: [Class] Class001\r\n" +
                                    "1.1: [Property] PROP00A /*...*/\r\n" +
                                    "1.1.1: [Property] PROP0A1 /*...*/\r\n" +
                                    "1.1.2: [Property] PROP0A2 /*...*/\r\n" +
                                    "1.2: [Property] PROP00B /*...*/\r\n" +
                                    "1.2.1: [Property] PROP0B1 /*...*/\r\n" +
                                    "1.2.2: [Property] PROP0B2 /*...*/" +
                                    "";

            Assert.That(formatter.Render(), Is.EqualTo(expected));
        }
예제 #3
0
        public void ClassWith2Properties()
        {
            IModel         model     = Build.Class("Class001").WithProperty("PROP001", "Comment").WithProperty("PROP002", "Comment").Model();
            ModelFormatter formatter = new ModelFormatter(model);

            Assert.That(formatter.Render(), Is.EqualTo("[Class] Class001\r\n  [Property] PROP001 /*...*/\r\n  [Property] PROP002 /*...*/"));
        }
예제 #4
0
        public void CobolModelWithPath()
        {
            ModelFormatter formatter = new ModelFormatter(new CobolModel("Name", "Data"))
            {
                IncludeModelPaths = true
            };

            Assert.That(formatter.Render(), Is.EqualTo("1: [Name] Data"));
        }
        public void ClassWith2DeepPropertiesWithPath()
        {
            IModel model = Build.Class("Class001")
                               .With(Build.Property("PROP001", "Comment")
                                          .WithProperty("PROP002", "Comment"))
                               .Model();
            ModelFormatter formatter = new ModelFormatter(model){IncludeModelPaths = true};

            Assert.That(formatter.Render(), Is.EqualTo("1: [Class] Class001\r\n1.1: [Property] PROP001 /*...*/\r\n1.1.1: [Property] PROP002 /*...*/"));
        }
예제 #6
0
        public void ClassWith2PropertiesWithPath()
        {
            IModel         model     = Build.Class("Class001").WithProperty("PROP001", "Comment").WithProperty("PROP002", "Comment").Model();
            ModelFormatter formatter = new ModelFormatter(model)
            {
                IncludeModelPaths = true
            };

            Assert.That(formatter.Render(), Is.EqualTo("1: [Class] Class001\r\n1.1: [Property] PROP001 /*...*/\r\n1.2: [Property] PROP002 /*...*/"));
        }
        public void SameModelConstructed()
        {
            IModel simpleModel = Build
                                 .Class("MSF006-RECORD")
                                 .With(
                Build.Property("KEY-006", "comment")
                .WithDataType("DSTRCT-CODE PIC X(4)", "comment")
                .WithDataType("ACCOUNT-CODE PIC X(24)", "comment")
                .With(
                    Build.Property("CONTROL-ID", "comment")
                    .With(
                        Build.DataType("CONTROL-TYPE PIC X(1)", "comment")
                        .WithValue("MIMS-CONTROL VALUE 'M'", "comment")
                        .WithValue("INTER-DSTRCT-CTL VALUE 'I'", "comment")
                        .WithValue("SUBLEDGER-CTL VALUE 'S'", "comment")
                        .WithValue("TABLE-DSTRCT-CTL VALUE 'T'", "comment")
                        )
                    )

                ).Model();

            IModel verboseModel = Build
                                  .Class("MSF006-RECORD")
                                  .With(
                Build.Property("KEY-006", "comment")
                .With(Build.DataType("DSTRCT-CODE PIC X(4)", "comment"))
                .With(Build.DataType("ACCOUNT-CODE PIC X(24)", "comment"))
                .With(
                    Build.Property("CONTROL-ID", "comment")
                    .With(
                        Build.DataType("CONTROL-TYPE PIC X(1)", "comment")
                        .WithValue("MIMS-CONTROL VALUE 'M'", "comment")
                        .WithValue("INTER-DSTRCT-CTL VALUE 'I'", "comment")
                        .WithValue("SUBLEDGER-CTL VALUE 'S'", "comment")
                        .WithValue("TABLE-DSTRCT-CTL VALUE 'T'", "comment")
                        )
                    )

                ).Model();

            string simple = new ModelFormatter(simpleModel)
            {
                IncludeModelPaths = true
            }.Render();
            string verbose = new ModelFormatter(verboseModel)
            {
                IncludeModelPaths = true
            }.Render();

            Assert.That(simple, Is.EqualTo(verbose));
        }
        public void ClassWith2BranchesOfPropertiesWithPath()
        {
            IModel model = Build
                .Class("Class001").With(
                    Build.Property("PROP00A", "Comment").WithProperty("PROP0A1", "Comment").WithProperty("PROP0A2", "Comment")
                )
                .With(
                    Build.Property("PROP00B", "Comment").WithProperty("PROP0B1", "Comment").WithProperty("PROP0B2", "Comment")
                ).Model();
            ModelFormatter formatter = new ModelFormatter(model){IncludeModelPaths = true};

            const string expected = "1: [Class] Class001\r\n" +
                                    "1.1: [Property] PROP00A /*...*/\r\n" +
                                    "1.1.1: [Property] PROP0A1 /*...*/\r\n" +
                                    "1.1.2: [Property] PROP0A2 /*...*/\r\n" +
                                    "1.2: [Property] PROP00B /*...*/\r\n" +
                                    "1.2.1: [Property] PROP0B1 /*...*/\r\n" +
                                    "1.2.2: [Property] PROP0B2 /*...*/" +
                                    "";

            Assert.That(formatter.Render(), Is.EqualTo(expected));
        }
        public void SameModelConstructed()
        {
            IModel simpleModel = Build
                .Class("MSF006-RECORD")
                .With(
                    Build.Property("KEY-006", "comment")
                         .WithDataType("DSTRCT-CODE PIC X(4)", "comment")
                         .WithDataType("ACCOUNT-CODE PIC X(24)", "comment")
                         .With(
                             Build.Property("CONTROL-ID", "comment")
                                  .With(
                                      Build.DataType("CONTROL-TYPE PIC X(1)", "comment")
                                           .WithValue("MIMS-CONTROL VALUE 'M'", "comment")
                                           .WithValue("INTER-DSTRCT-CTL VALUE 'I'", "comment")
                                           .WithValue("SUBLEDGER-CTL VALUE 'S'", "comment")
                                           .WithValue("TABLE-DSTRCT-CTL VALUE 'T'", "comment")
                                 )
                        )

                ).Model();

            IModel verboseModel = Build
                .Class("MSF006-RECORD")
                .With(
                    Build.Property("KEY-006", "comment")
                         .With(Build.DataType("DSTRCT-CODE PIC X(4)", "comment"))
                         .With(Build.DataType("ACCOUNT-CODE PIC X(24)", "comment"))
                         .With(
                             Build.Property("CONTROL-ID", "comment")
                                  .With(
                                      Build.DataType("CONTROL-TYPE PIC X(1)", "comment")
                                           .WithValue("MIMS-CONTROL VALUE 'M'", "comment")
                                           .WithValue("INTER-DSTRCT-CTL VALUE 'I'", "comment")
                                           .WithValue("SUBLEDGER-CTL VALUE 'S'", "comment")
                                           .WithValue("TABLE-DSTRCT-CTL VALUE 'T'", "comment")
                                 )
                        )

                ).Model();

            string simple = new ModelFormatter(simpleModel) {IncludeModelPaths = true}.Render();
            string verbose = new ModelFormatter(verboseModel) { IncludeModelPaths = true }.Render();

            Assert.That(simple, Is.EqualTo(verbose));
        }
        public void IgnoreModel()
        {
            ModelFormatter formatter = new ModelFormatter(new IgnoreModel("This is some data"));

            Assert.That(formatter.Render(), Is.EqualTo("[Ignore] This is some data"));
        }
예제 #11
0
        public void StringModel()
        {
            ModelFormatter formatter = new ModelFormatter(new StringModel("Name", "Data"));

            Assert.That(formatter.Render(), Is.EqualTo("[Name] Data"));
        }
예제 #12
0
        public void PageHeader()
        {
            ModelFormatter formatter = new ModelFormatter(new PageHeaderModel(new [] { "One", "Two", "Three" }));

            Assert.That(formatter.Render(), Is.EqualTo("[Page] One\r\n[Page] Two\r\n[Page] Three\r\n"));
        }
예제 #13
0
        public void IgnoreModel()
        {
            ModelFormatter formatter = new ModelFormatter(new IgnoreModel("This is some data"));

            Assert.That(formatter.Render(), Is.EqualTo("[Ignore] This is some data"));
        }
예제 #14
0
        public void CobolModelWithComment()
        {
            ModelFormatter formatter = new ModelFormatter(new CobolModel("Name", "Data", "Comment"));

            Assert.That(formatter.Render(), Is.EqualTo("[Name] Data /*...*/"));
        }
        public void PageHeader()
        {
            ModelFormatter formatter = new ModelFormatter(new PageHeaderModel( new [] {"One", "Two", "Three"}));

            Assert.That(formatter.Render(), Is.EqualTo("[Page] One\r\n[Page] Two\r\n[Page] Three\r\n"));
        }
        public void StringModel()
        {
            ModelFormatter formatter = new ModelFormatter(new StringModel("Name", "Data"));

            Assert.That(formatter.Render(), Is.EqualTo("[Name] Data"));
        }
        public void CobolModelWithComment()
        {
            ModelFormatter formatter = new ModelFormatter(new CobolModel("Name", "Data", "Comment"));

            Assert.That(formatter.Render(), Is.EqualTo("[Name] Data /*...*/"));
        }
        public void StringModelWithPath()
        {
            ModelFormatter formatter = new ModelFormatter(new StringModel("Name", "Data")) { IncludeModelPaths = true };

            Assert.That(formatter.Render(), Is.EqualTo("1: [Name] Data"));
        }