Skip to content

LabsUITestMethod generator should check for VisualUITestBase #187

Open

Description

@michael-hawker

The [LabsUITestMethod] requires that the class inherits from VisualUITestBase, we should have an analysis step which checks for that. Otherwise you'll get a compile error about not being able to find the EnqueueAsync method.

Activity

  1. added this to the Future milestone on Jul 7, 2022
  2. Arlodotexe commented on Jul 8, 2022

    @Arlodotexe
    Member

    We might consider using an interface instead with the minimal requirements for the Source Generator to function, similar to what we do for the generated option panes

    That way, we're only tying the source generator to the EnqueueAsync methods.

  3. michael-hawker commented on Jul 8, 2022

    @michael-hawker
    MemberAuthor

    I mean the VisualUITestBase as the load content method too and everything, so I think it's fine to require inheriting from the base class. And the template does this with #189, so not a high priority. But a gotcha if you create a new test class and try and use the attribute. I know @Sergio0694 does this for some of the new attributes in the MVVM Toolkit, so just a simple check if the [LabsUITestMethod] is used but the class isn't inheriting from VisualUITestBase then we put an explicit error message to assist.

  4. Arlodotexe commented on Jul 8, 2022

    @Arlodotexe
    Member

    I mean the VisualUITestBase as the load content method too and everything, so I think it's fine to require inheriting from the base class.

    Of course, keep the base class and keep using it. But the base class uses WinUI, and we don't need to make the source generator rely on that. This is something I was hoping to do when I set up the source generator in the first place, but couldn't due to time constraints. Interface would contain the minimum members that the Source generator would need to function.

    But a gotcha if you create a new test class and try and use the attribute.

    Definitely need this, yes. Since this source generator isn't being published, we can show "VisualUITestBase" in the error message, rather than the interface name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions