public void WhenTypeAttributeIsNotFound_ThenThrows()
        {
            var processor = new ModelElementDirectiveProcessor();

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

            processor.StartProcessingRun(provider, null, new CompilerErrorCollection());
            Assert.Throws <DirectiveProcessorException>(() => processor.ProcessDirective("ModelElement", new Dictionary <string, string>()));
        }
        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));"));
        }
        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));"));
        }