# Annotation

We provide a seamless workflow integrations for devs by working via code annotations and build\_runner CLI.&#x20;

### `@Welltested()`

You can mark all the methods inside a class to be tested by adding `@Welltested()` annotation.&#x20;

```dart
import 'package:welltested/welltested.dart';

@Welltested()
class Auth {
    Future<void> logInUser() {...}
    Future<void> logOutUser() {...}
}
```

In above example, we will generate unit tests for `logInUser` and `logOutUser` methods of `Auth` class.

> Note: We currently don't support testing top-level (global) functions. Coming soon.

### Testcases

Our testing AI auto decides smart exhaustive test cases for each function based on its use case and contextual code. However you can specify your own custom test cases for a method by adding [`@Testcases()`](/v1/welltested-ai/unit-tests/good-to-knows/custom-testcases.md) annotation to them.

{% hint style="info" %}
IDE Assist: You can also use [*`Fetch Unit Testcases`*](/v1/welltested-ai/ide-assist/code-actions.md#fetch-unit-testcases)to review unit test cases and also modify them.
{% endhint %}

### Exclude Methods

By default, all methods in an annotated class are included. To exclude any method from testing, add their name to the `excludedMethods` list in the `Welltested` annotation.

```dart
@Welltested(excludedMethods: ['logOutUser'])
class Auth {
    Future<void> logInUser() {...}
    Future<void> logOutUser() {...}
}
```

{% hint style="info" %}
IDE Assist: You may use [*`Exclude Method`*](/v1/welltested-ai/ide-assist/code-actions.md#exclude-methods)or [*`Exclude Other Methods`*](/v1/welltested-ai/ide-assist/code-actions.md#exclude-methods) to run bulk excludes.
{% endhint %}

In the above case, we will not create unit tests for `logOutUser`.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.welltested.ai/v1/welltested-ai/unit-tests/annotation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
