You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
LabsUITestMethod generator should check for VisualUITestBase #187
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.
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.
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.
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.
Activity
Arlodotexe commentedon Jul 8, 2022
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.
michael-hawker commentedon Jul 8, 2022
I mean the
VisualUITestBaseas 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 fromVisualUITestBasethen we put an explicit error message to assist.Arlodotexe commentedon Jul 8, 2022
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.
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.