public void AnnotateDeclarationRefactoringAction_AdjustAttributeSet_WorksWithExistingAnnotation_Module() { const string code = @"Attribute VB_Exposed = False '@Folder ""MyFolder"" '@DefaultMember Public Sub Foo() End Sub "; const string expectedCode = @"Attribute VB_Exposed = False Attribute VB_Description = ""MyDesc"" '@ModuleDescription ""MyDesc"" '@Folder ""MyFolder"" '@DefaultMember Public Sub Foo() End Sub "; Func <RubberduckParserState, AnnotateDeclarationModel> modelBuilder = (state) => { var declaration = state.DeclarationFinder .UserDeclarations(DeclarationType.Module) .Single(); var annotation = new ModuleDescriptionAnnotation(); var arguments = new List <TypedAnnotationArgument> { new TypedAnnotationArgument(AnnotationArgumentType.Text, "MyDesc") }; return(new AnnotateDeclarationModel(declaration, annotation, arguments, true)); }; var refactoredCode = RefactoredCode(code, modelBuilder); Assert.AreEqual(expectedCode, refactoredCode); }
public void ModuleDescriptionAnnotation_TypeIsModuleDescription() { var annotation = new ModuleDescriptionAnnotation(new QualifiedSelection(), null, new[] { "Desc" }); Assert.AreEqual(AnnotationType.ModuleDescription, annotation.AnnotationType); }