예제 #1
0
        public void InheritedRelatedLocalAttributesShouldTrigger()
        {
            var syntaxTree    = SyntaxTreeTestFactory.FromTestFilePath("InheritedRelatedLocalAttribute.cs");
            var compilation   = CompilationHelper.CreateCompilation(new[] { syntaxTree });
            var transformable = TransformLocator.IsTransformable(compilation, syntaxTree);

            transformable.ShouldBe(true);
        }
예제 #2
0
        public void UnrelatedAssemblyAttributesShouldNotTrigger()
        {
            var syntaxTree    = SyntaxTreeTestFactory.FromTestFilePath("UnrelatedAssemblyAttribute.cs");
            var compilation   = CompilationHelper.CreateCompilation(new[] { syntaxTree });
            var transformable = TransformLocator.IsTransformable(compilation, syntaxTree);

            transformable.ShouldBe(false);
        }
예제 #3
0
        /// <inheritdoc />
        public override bool Execute()
        {
            try
            {
                var task = System.Threading.Tasks.Task.Run(() => TransformLocator.GetAffectedDocumentsAsync(BuildEngine.ProjectFileOfTaskNode));
                var affectedDocuments = task.Result;
                TouchedFilePaths = affectedDocuments.Select(d => new TaskItem(d.FilePath)).ToArray();

                return(true);
            }
            catch (Exception e)
            {
                Log.LogErrorFromException(e);
                return(false);
            }
        }