コード例 #1
0
        public void WhenTypeAttributeIsNotFound_ThenThrows()
        {
            var processor = new ModelElementDirectiveProcessor();

            processor.StartProcessingRun(provider, null, new CompilerErrorCollection());
            Assert.Throws<DirectiveProcessorException>(() => processor.ProcessDirective("ModelElement", new Dictionary<string, string>()));
        }
コード例 #2
0
        public void WhenTypeAttributeIsNotFound_ThenThrows()
        {
            var processor = new ModelElementDirectiveProcessor();

            processor.StartProcessingRun(provider, null, new CompilerErrorCollection());
            Assert.Throws <DirectiveProcessorException>(() => processor.ProcessDirective("ModelElement", new Dictionary <string, string>()));
        }
コード例 #3
0
        public void WhenTypeAttributeIsFound_ThenElementPropertyIsGenerated()
        {
            var processor = new ModelElementDirectiveProcessor();

            processor.StartProcessingRun(provider, null, new CompilerErrorCollection());
            processor.ProcessDirective("ModelElement", directiveAttributes);
            var result = processor.GetClassCodeForProcessingRun();

            Assert.NotNull(result);
            Assert.True(result.Contains("public new Foo.Bar Element"));
            Assert.True(result.Contains("return ((Foo.Bar)(base.Element));"));
        }
コード例 #4
0
        public void WhenTypeAttributeIsFound_ThenElementPropertyIsGenerated()
        {
            var processor = new ModelElementDirectiveProcessor();

            processor.StartProcessingRun(provider, null, new CompilerErrorCollection());
            processor.ProcessDirective("ModelElement", directiveAttributes);
            var result = processor.GetClassCodeForProcessingRun();

            Assert.NotNull(result);
            Assert.True(result.Contains("public new Foo.Bar Element"));
            Assert.True(result.Contains("return ((Foo.Bar)(base.Element));"));
        }