コード例 #1
0
        public void WhenGettingReferenceWithEmptyElementAssemblyPath_ThenThrows()
        {
            var processor = new ModelElementDirectiveProcessor();
            CallContext.LogicalSetData(ModelElementDirectiveProcessor.KeyCallContextElementAssemblyPath, "");

            Assert.Throws<DirectiveProcessorException>(() => processor.GetReferencesForProcessingRun());
        }
コード例 #2
0
        public void WhenGettingReferenceWithNonExistingElementAssemblyPath_ThenThrows()
        {
            var processor = new ModelElementDirectiveProcessor();

            CallContext.LogicalSetData(ModelElementDirectiveProcessor.KeyCallContextElementAssemblyPath, "C:\\Temp\\" + Guid.NewGuid().ToString("X") + ".dll");

            Assert.Throws <DirectiveProcessorException>(() => processor.GetReferencesForProcessingRun());
        }
コード例 #3
0
        public void WhenGettingReferenceWithEmptyElementAssemblyPath_ThenThrows()
        {
            var processor = new ModelElementDirectiveProcessor();

            CallContext.LogicalSetData(ModelElementDirectiveProcessor.KeyCallContextElementAssemblyPath, "");

            Assert.Throws <DirectiveProcessorException>(() => processor.GetReferencesForProcessingRun());
        }
コード例 #4
0
        public void WhenGettingReferenceAndElementAssemblyPathWasDefined_ThenReturnsDefaultReferencesAndElementReference()
        {
            var processor = new ModelElementDirectiveProcessor();

            var elementAssemblyPath = Path.GetTempFileName();

            CallContext.LogicalSetData(ModelElementDirectiveProcessor.KeyCallContextElementAssemblyPath, elementAssemblyPath);
            var references = processor.GetReferencesForProcessingRun();

            Assert.True(references.Contains(elementAssemblyPath));
        }
コード例 #5
0
        public void WhenGettingReference_ThenReturnsDefaultReferences()
        {
            var processor           = new ModelElementDirectiveProcessor();
            var elementAssemblyPath = this.GetType().Assembly.ManifestModule.FullyQualifiedName;

            CallContext.LogicalSetData(ModelElementDirectiveProcessor.KeyCallContextElementAssemblyPath, elementAssemblyPath);

            var references = processor.GetReferencesForProcessingRun();

            Assert.True(references.Contains(typeof(IQueryable).Assembly.Location));
            Assert.True(references.Contains(typeof(IVsHierarchy).Assembly.Location));
            Assert.True(references.Contains(typeof(ModelElement).Assembly.Location));
            Assert.True(references.Contains(typeof(IModelBus).Assembly.Location));
            Assert.True(references.Contains(typeof(ModelBusEnabledTextTransformation).Assembly.Location));
        }
コード例 #6
0
        public void WhenGettingReference_ThenReturnsDefaultReferences()
        {
            var processor = new ModelElementDirectiveProcessor();
            var elementAssemblyPath = this.GetType().Assembly.ManifestModule.FullyQualifiedName;
            CallContext.LogicalSetData(ModelElementDirectiveProcessor.KeyCallContextElementAssemblyPath, elementAssemblyPath);

            var references = processor.GetReferencesForProcessingRun();

            Assert.True(references.Contains(typeof(IQueryable).Assembly.Location));
            Assert.True(references.Contains(typeof(IVsHierarchy).Assembly.Location));
            Assert.True(references.Contains(typeof(ModelElement).Assembly.Location));
            Assert.True(references.Contains(typeof(IModelBus).Assembly.Location));
            Assert.True(references.Contains(typeof(ModelBusEnabledTextTransformation).Assembly.Location));
        }
コード例 #7
0
        public void WhenGettingReferenceWithNonExistingElementAssemblyPath_ThenThrows()
        {
            var processor = new ModelElementDirectiveProcessor();
            CallContext.LogicalSetData(ModelElementDirectiveProcessor.KeyCallContextElementAssemblyPath, "C:\\Temp\\" + Guid.NewGuid().ToString("X") + ".dll");

            Assert.Throws<DirectiveProcessorException>(() => processor.GetReferencesForProcessingRun());
        }
コード例 #8
0
        public void WhenGettingReferenceWithoutElementAssemblyPath_ThenThrows()
        {
            var processor = new ModelElementDirectiveProcessor();

            Assert.Throws<DirectiveProcessorException>(() => processor.GetReferencesForProcessingRun());
        }
コード例 #9
0
        public void WhenGettingReferenceAndElementAssemblyPathWasDefined_ThenReturnsDefaultReferencesAndElementReference()
        {
            var processor = new ModelElementDirectiveProcessor();

            var elementAssemblyPath = Path.GetTempFileName();
            CallContext.LogicalSetData(ModelElementDirectiveProcessor.KeyCallContextElementAssemblyPath, elementAssemblyPath);
            var references = processor.GetReferencesForProcessingRun();

            Assert.True(references.Contains(elementAssemblyPath));
        }
コード例 #10
0
        public void WhenGettingReferenceWithoutElementAssemblyPath_ThenThrows()
        {
            var processor = new ModelElementDirectiveProcessor();

            Assert.Throws <DirectiveProcessorException>(() => processor.GetReferencesForProcessingRun());
        }