コード例 #1
0
            public ITemplateModel Copy()
            {
                var result = new TemplateModelForTest();

                result.TemplatedFilePath    = result.TemplatedFilePath;
                result.TemplatedFileContent = result.TemplatedFileContent;
                return(result);
            }
コード例 #2
0
        public void InlineMappingLoadTest()
        {
            var firstContext = $@"{{:TDB:PREPROCESSOR:MAPPING:DECLARE(
[->({envB})<-]<=>[
[->({envAType1})<-]=>[->({envBType1})<-],
[->({envAType2})<-]=>[->({envBType2})<-],
[->({envAType3})<-]=>[->({envBType3})<-]
]
):PREPROCESSOR:}}";

            var secondContext = $@"{{:TDB:PREPROCESSOR:MAPPING:DECLARE(
[->({envC})<-]<=>[
[->({envAType1})<-]=>[->({envCType1})<-],
[->({envAType2})<-]=>[->({envCType2})<-],
[->({envAType3})<-]=>[->({envCType3})<-]
]
):PREPROCESSOR:}}";

            string preprocessed = $@"{firstContext}

{secondContext}
";
            var    preprocessedTemplateModel = new TemplateModelForTest()
            {
                TemplatedFileContent = preprocessed
            };

            _tested.PreProcess(new List <ITemplateModel>()
            {
                preprocessedTemplateModel
            });

            var expectedPreprocessedResult = $@"


";

            Assert.AreEqual(expectedPreprocessedResult, preprocessedTemplateModel.TemplatedFileContent);
        }