CommunityToolkit / CommunityToolkit/Tooling-Windows-Submodule

`[UIThreadTestMethod]` should have Analyzer to ensure parent class inherits from `VisualUITestBase`

Abierto
#42 0 comentarios 0 reacciones 0 asignados Ver en GitHub
bug :bug: source generator :gear: testing 🏗
Lenguaje dominante
C#
Estrellas
55
Forks
19
Merge medio
40 min
PR fusionados (30 d)
1

Descripción

### Describe the bug

The Source Generator tries to call `EnqueueAsync` on the class, but this is a method from `VisualUITestBase`, so if you try and use the generator attribute without inheriting from the class, you can an error about it not finding the method.

We should have an analyzer here to help guide folks to knowing that they have to inherit from the class. That and/or we should figure out a way to capture the dispatcher at the right point in test initialization so that we can just use it for the generated methods without needing a special base class?

### Steps to reproduce

```text
Use `UIThreadTestMethod` in a class not inheriting from `VisualUITestBase`
```

### Expected behavior

Help in guiding to the right path.

### Screenshots

_No response_

### Code Platform

- [ ] UWP
- [ ] WinAppSDK / WinUI 3
- [ ] Web Assembly (WASM)
- [ ] Android
- [ ] iOS
- [ ] MacOS
- [ ] Linux / GTK

### Windows Build Number

- [ ] Windows 10 1809 (Build 17763)
- [ ] Windows 10 1903 (Build 18362)
- [ ] Windows 10 1909 (Build 18363)
- [ ] Windows 10 2004 (Build 19041)
- [ ] Windows 10 20H2 (Build 19042)
- [ ] Windows 10 21H1 (Build 19043)
- [ ] Windows 11 21H2 (Build 22000)
- [ ] Other (specify)

### Other Windows Build number

_No response_

### App minimum and target SDK version

- [ ] Windows 10, version 1809 (Build 17763)
- [ ] Windows 10, version 1903 (Build 18362)
- [ ] Windows 10, version 1909 (Build 18363)
- [ ] Windows 10, version 2004 (Build 19041)
- [ ] Other (specify)

### Other SDK version

_No response_

### Visual Studio Version

_No response_

### Visual Studio Build Number

_No response_

### Device form factor

_No response_

### Additional context

_No response_

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comienza localizando el generador de código fuente que gestiona UIThreadTestMethod y la llamada a EnqueueAsync; después, inspecciona VisualUITestBase para confirmar la relación de herencia requerida. Se considera terminado cuando el uso no válido del atributo recibe una orientación clara del analizador, con pruebas que cubran una clase que hereda de VisualUITestBase y otra que no.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
csharp
Área
testing, tooling
Tipo de issue
Nueva funcionalidad
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.