> ## Documentation Index
> Fetch the complete documentation index at: https://ancplua.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Shared Utilities

> Guard clauses and test helpers injected by default.

The SDK injects utility code into your project at build time.

## Throw

Guard clause utilities for parameter validation.

```csharp theme={null}
public void Process(string input)
{
    Throw.IfNull(input);
    Throw.IfNullOrEmpty(input);
    Throw.IfNullOrWhiteSpace(input);
}
```

Available methods:

| Method                            | Throws when                          |
| --------------------------------- | ------------------------------------ |
| `Throw.IfNull(value)`             | Value is null                        |
| `Throw.IfNullOrEmpty(value)`      | String is null or empty              |
| `Throw.IfNullOrWhiteSpace(value)` | String is null, empty, or whitespace |

## BuildTestCode

Test utility for compiling C# code in analyzer tests.

<Note>
  Opt-in only. Requires `   <InjectSharedBuildTestCode>true</InjectSharedBuildTestCode>`.
</Note>

## Opt-out

Disable default injection:

```xml theme={null}
<PropertyGroup>
  <InjectSharedThrow>false</InjectSharedThrow>
</PropertyGroup>
```
