fluentassertions / fluentassertions/fluentassertions

Add `Eventually` polling assertions for eventually-consistent scenarios

Abierto
#3,263 0 comentarios 0 reacciones 0 asignados Ver en GitHub
api-suggestion feature
Lenguaje dominante
C#
Estrellas
3.8k
Forks
720
Merge medio
1 d 1 h
PR fusionados (30 d)
29

Descripción

Integration tests against message queues, background workers, file watchers or UI state often need to wait until an assertion *eventually* passes. Today people hand-roll retry loops or pull in a separate library (Awaitility-style).

Proposed API:

```csharp
await Eventually.Satisfy(() => queue.Count.Should().Be(3), within: 5.Seconds(), checkEvery: 100.Milliseconds());
```

It would repeatedly evaluate the assertion action, swallowing failures until it passes or the timeout expires, then rethrow the last failure. The internal `IClock`/`ITimer` abstraction can drive this testably. Relates to the `TimeProvider` idea (separate issue) for deterministic testing.

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Start by locating the existing IClock and ITimer abstractions and the assertion execution conventions. Review how timeout and assertion failures are currently represented, then determine the API and deterministic test coverage needed for Eventually.Satisfy. Done means the proposed polling behavior, timeout handling, and last-failure propagation are specified and tested.

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

Evaluación

Stack tecnológico
csharp
Área
testing
Tipo de issue
Nueva funcionalidad
Dificultad
5/5
Tiempo estimado
Más de una semana
Estado de actividad
Tranquilo
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.