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

# BreakdanceTestBase

> A base class for unit tests that maintains an [IHost](https://learn.microsoft.com/dotnet/api/microsoft.extensions.hosting.ihost) with configuration and a Dep...

## Definition

**Assembly:** CloudNimble.Breakdance.Assemblies.dll

**Namespace:** CloudNimble.Breakdance.Assemblies

**Inheritance:** System.Object

## Syntax

```csharp theme={"dark"}
CloudNimble.Breakdance.Assemblies.BreakdanceTestBase
```

## Summary

A base class for unit tests that maintains an [IHost](https://learn.microsoft.com/dotnet/api/microsoft.extensions.hosting.ihost) with configuration and a Dependency Injection container.

## Constructors

### <Icon icon="hammer" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> .ctor

Creates a new [BreakdanceTestBase](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/BreakdanceTestBase) instance.

#### Syntax

```csharp theme={"dark"}
public BreakdanceTestBase()
```

### <Icon icon="hammer" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> .ctor <Badge color="gray">Inherited</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
public Object()
```

## Properties

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> DefaultScope

Provides a default [IServiceScope](https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicescope) implementation to contain scoped services.

#### Syntax

```csharp theme={"dark"}
public Microsoft.Extensions.DependencyInjection.IServiceScope DefaultScope { get; set; }
```

#### Property Value

Type: `Microsoft.Extensions.DependencyInjection.IServiceScope`

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> TestHost

The [IHost](https://learn.microsoft.com/dotnet/api/microsoft.extensions.hosting.ihost) instance containing the test host.

#### Syntax

```csharp theme={"dark"}
public Microsoft.Extensions.Hosting.IHost TestHost { get; internal set; }
```

#### Property Value

Type: `Microsoft.Extensions.Hosting.IHost`

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> TestHostBuilder

The [IHostBuilder](/breakdance/api-reference/Microsoft/Extensions/Hosting/IHostBuilder) instance used to configure the test host.

#### Syntax

```csharp theme={"dark"}
public Microsoft.Extensions.Hosting.IHostBuilder TestHostBuilder { get; internal set; }
```

#### Property Value

Type: `Microsoft.Extensions.Hosting.IHostBuilder`

## Methods

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> AssemblySetup <Badge color="orange">Virtual</Badge>

Method used by test assemblies to setup the environment.

#### Syntax

```csharp theme={"dark"}
public virtual void AssemblySetup()
```

#### Remarks

With MSTest, use \[AssemblyInitialize].
With NUnit, use \[OneTimeSetup].
With xUnit, good luck: [https://xunit.net/docs/shared-context](https://xunit.net/docs/shared-context)
This method calls [BreakdanceTestBase.AssemblySetupAsync](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/BreakdanceTestBase#assemblysetupasync) synchronously.

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> AssemblySetupAsync <Badge color="orange">Virtual</Badge>

Method used by test assemblies to setup the environment asynchronously.

#### Syntax

```csharp theme={"dark"}
public virtual System.Threading.Tasks.Task AssemblySetupAsync()
```

#### Returns

Type: `System.Threading.Tasks.Task`

#### Remarks

With MSTest, use \[AssemblyInitialize] with async Task return type.
With NUnit, use \[OneTimeSetup] with async Task return type.
With xUnit, good luck: [https://xunit.net/docs/shared-context](https://xunit.net/docs/shared-context)

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> AssemblyTearDown <Badge color="orange">Virtual</Badge>

Method used by test assemblies to clean up the environment.

#### Syntax

```csharp theme={"dark"}
public virtual void AssemblyTearDown()
```

#### Remarks

With MSTest, use \[AssemblyCleanup].
With NUnit, use \[OneTimeTearDown].
With xUnit, good luck: [https://xunit.net/docs/shared-context](https://xunit.net/docs/shared-context)
This method calls [BreakdanceTestBase.AssemblyTearDownAsync](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/BreakdanceTestBase#assemblyteardownasync) synchronously.

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> AssemblyTearDownAsync <Badge color="orange">Virtual</Badge>

Method used by test assemblies to clean up the environment asynchronously.

#### Syntax

```csharp theme={"dark"}
public virtual System.Threading.Tasks.Task AssemblyTearDownAsync()
```

#### Returns

Type: `System.Threading.Tasks.Task`

#### Remarks

With MSTest, use \[AssemblyCleanup] with async Task return type.
With NUnit, use \[OneTimeTearDown] with async Task return type.
With xUnit, good luck: [https://xunit.net/docs/shared-context](https://xunit.net/docs/shared-context)

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> ClassSetup <Badge color="orange">Virtual</Badge>

Method used by test classes to setup the environment.

#### Syntax

```csharp theme={"dark"}
public virtual void ClassSetup()
```

#### Remarks

With MSTest, use \[ClassInitialize].
With NUnit, use \[OneTimeSetup].
With xUnit, good luck: [https://xunit.net/docs/shared-context](https://xunit.net/docs/shared-context)
This method calls [BreakdanceTestBase.ClassSetupAsync](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/BreakdanceTestBase#classsetupasync) synchronously.

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> ClassSetupAsync <Badge color="orange">Virtual</Badge>

Method used by test classes to setup the environment asynchronously.

#### Syntax

```csharp theme={"dark"}
public virtual System.Threading.Tasks.Task ClassSetupAsync()
```

#### Returns

Type: `System.Threading.Tasks.Task`

#### Remarks

With MSTest, use \[ClassInitialize] with async Task return type.
With NUnit, use \[OneTimeSetup] with async Task return type.
With xUnit, good luck: [https://xunit.net/docs/shared-context](https://xunit.net/docs/shared-context)

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> ClassTearDown <Badge color="orange">Virtual</Badge>

Method used by test classes to clean up the environment.

#### Syntax

```csharp theme={"dark"}
public virtual void ClassTearDown()
```

#### Remarks

With MSTest, use \[ClassCleanup].
With NUnit, use \[OneTimeTearDown].
With xUnit, good luck: [https://xunit.net/docs/shared-context](https://xunit.net/docs/shared-context)
This method calls [BreakdanceTestBase.ClassTearDownAsync](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/BreakdanceTestBase#classteardownasync) synchronously.

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> ClassTearDownAsync <Badge color="orange">Virtual</Badge>

Method used by test classes to clean up the environment asynchronously.

#### Syntax

```csharp theme={"dark"}
public virtual System.Threading.Tasks.Task ClassTearDownAsync()
```

#### Returns

Type: `System.Threading.Tasks.Task`

#### Remarks

With MSTest, use \[ClassCleanup] with async Task return type.
With NUnit, use \[OneTimeTearDown] with async Task return type.
With xUnit, good luck: [https://xunit.net/docs/shared-context](https://xunit.net/docs/shared-context)

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> Dispose

Clean up disposable objects in the environment.

#### Syntax

```csharp theme={"dark"}
public void Dispose()
```

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> DisposeAsync

Asynchronously clean up disposable objects in the environment.

#### Syntax

```csharp theme={"dark"}
public System.Threading.Tasks.ValueTask DisposeAsync()
```

#### Returns

Type: `System.Threading.Tasks.ValueTask`

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> Equals <Badge color="gray">Inherited</Badge> <Badge color="orange">Virtual</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
public virtual bool Equals(object obj)
```

#### Parameters

| Name  | Type      | Description |
| ----- | --------- | ----------- |
| `obj` | `object?` | -           |

#### Returns

Type: `bool`

### <Icon icon="thumbtack" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> Equals <Badge color="gray">Inherited</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
public static bool Equals(object objA, object objB)
```

#### Parameters

| Name   | Type      | Description |
| ------ | --------- | ----------- |
| `objA` | `object?` | -           |
| `objB` | `object?` | -           |

#### Returns

Type: `bool`

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> GetHashCode <Badge color="gray">Inherited</Badge> <Badge color="orange">Virtual</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
public virtual int GetHashCode()
```

#### Returns

Type: `int`

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> GetKeyedService <Badge color="orange">Virtual</Badge>

Get service of type *T* from the System.IServiceProvider.

#### Syntax

```csharp theme={"dark"}
public virtual T GetKeyedService<T>(string key) where T : class
```

#### Parameters

| Name  | Type     | Description                    |
| ----- | -------- | ------------------------------ |
| `key` | `string` | The key of the service to get. |

#### Returns

Type: `T`
A service object of type *T*.

#### Type Parameters

* `T` - The type of service object to get.

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> GetKeyedServices <Badge color="orange">Virtual</Badge>

Get services of type *T* from the System.IServiceProvider.

#### Syntax

```csharp theme={"dark"}
public virtual System.Collections.Generic.IEnumerable<T> GetKeyedServices<T>(string key) where T : class
```

#### Parameters

| Name  | Type     | Description |
| ----- | -------- | ----------- |
| `key` | `string` | The         |

#### Returns

Type: `System.Collections.Generic.IEnumerable<T>`
An [IEnumerable\`1](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1) of type *T*.

#### Type Parameters

* `T` - The type of service object to get.

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> GetScopedService

Get the requested service from the specified [IServiceScope](https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicescope).

#### Syntax

```csharp theme={"dark"}
public T GetScopedService<T>(Microsoft.Extensions.DependencyInjection.IServiceScope scope) where T : class
```

#### Parameters

| Name    | Type                                                     | Description |
| ------- | -------------------------------------------------------- | ----------- |
| `scope` | `Microsoft.Extensions.DependencyInjection.IServiceScope` | -           |

#### Returns

Type: `T`

#### Type Parameters

* `T` -

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> GetScopedService

Get the requested service from the default [IServiceScope](https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicescope) provided by Breakdance.

#### Syntax

```csharp theme={"dark"}
public T GetScopedService<T>() where T : class
```

#### Returns

Type: `T`

#### Type Parameters

* `T` -

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> GetScopedServices

Get the requested service from the specified [IServiceScope](https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicescope).

#### Syntax

```csharp theme={"dark"}
public System.Collections.Generic.IEnumerable<T> GetScopedServices<T>(Microsoft.Extensions.DependencyInjection.IServiceScope scope) where T : class
```

#### Parameters

| Name    | Type                                                     | Description |
| ------- | -------------------------------------------------------- | ----------- |
| `scope` | `Microsoft.Extensions.DependencyInjection.IServiceScope` | -           |

#### Returns

Type: `System.Collections.Generic.IEnumerable<T>`

#### Type Parameters

* `T` -

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> GetScopedServices

Get the requested service from the default [IServiceScope](https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicescope) provided by Breakdance.

#### Syntax

```csharp theme={"dark"}
public System.Collections.Generic.IEnumerable<T> GetScopedServices<T>() where T : class
```

#### Returns

Type: `System.Collections.Generic.IEnumerable<T>`

#### Type Parameters

* `T` -

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> GetService <Badge color="orange">Virtual</Badge>

Get service of type *T* from the System.IServiceProvider.

#### Syntax

```csharp theme={"dark"}
public virtual T GetService<T>() where T : class
```

#### Returns

Type: `T`
A service object of type *T*.

#### Type Parameters

* `T` - The type of service object to get.

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> GetServices <Badge color="orange">Virtual</Badge>

Get an enumeration of services of type *T* from the System.IServiceProvider.

#### Syntax

```csharp theme={"dark"}
public virtual System.Collections.Generic.IEnumerable<T> GetServices<T>() where T : class
```

#### Returns

Type: `System.Collections.Generic.IEnumerable<T>`
An enumeration of services of type *T*.

#### Type Parameters

* `T` - The type of service object to get.

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> GetType <Badge color="gray">Inherited</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
public System.Type GetType()
```

#### Returns

Type: `System.Type`

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> MemberwiseClone <Badge color="gray">Inherited</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
protected internal object MemberwiseClone()
```

#### Returns

Type: `object`

### <Icon icon="thumbtack" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> ReferenceEquals <Badge color="gray">Inherited</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
public static bool ReferenceEquals(object objA, object objB)
```

#### Parameters

| Name   | Type      | Description |
| ------ | --------- | ----------- |
| `objA` | `object?` | -           |
| `objB` | `object?` | -           |

#### Returns

Type: `bool`

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> ResetTestHostBuilder

Resets the test host by disposing of the current TestHost and initializing a new default TestHostBuilder.
This prepares the environment for a fresh test setup.

#### Syntax

```csharp theme={"dark"}
public void ResetTestHostBuilder()
```

### <Icon icon="thumbtack" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> SetClaimsPrincipalSelectorToThreadPrincipal

Sets the [ClaimsPrincipalSelector](https://learn.microsoft.com/dotnet/api/system.security.claims.claimsprincipal.claimsprincipalselector) to the [CurrentPrincipal](https://learn.microsoft.com/dotnet/api/system.threading.thread.currentprincipal).

#### Syntax

```csharp theme={"dark"}
public static void SetClaimsPrincipalSelectorToThreadPrincipal()
```

#### Remarks

This is used in non-ASP.NET Core testing situations where you're not going to pull the Identity from a request-specific DI Container.

### <Icon icon="thumbtack" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> SetClaimsPrincipalSelectorToThreadPrincipal

Sets the [ClaimsPrincipalSelector](https://learn.microsoft.com/dotnet/api/system.security.claims.claimsprincipal.claimsprincipalselector) to the [CurrentPrincipal](https://learn.microsoft.com/dotnet/api/system.threading.thread.currentprincipal) and sets the latter to a new ClaimsIdentity with the specified claims.

#### Syntax

```csharp theme={"dark"}
public static void SetClaimsPrincipalSelectorToThreadPrincipal(System.Collections.Generic.List<System.Security.Claims.Claim> claims, string authenticationType = "BreakdanceTests", string nameType = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier", string roleType = "http://schemas.microsoft.com/ws/2008/06/identity/claims/role")
```

#### Parameters

| Name                 | Type                                                            | Description                                                                                                                                                         |
| -------------------- | --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `claims`             | `System.Collections.Generic.List<System.Security.Claims.Claim>` | The Claims to set for the test run.                                                                                                                                 |
| `authenticationType` | `string`                                                        | If needed, the AuthenticationType of the ClaimsIdentity. Defaults to "BreakdanceTests".                                                                             |
| `nameType`           | `string`                                                        | The ClaimType to specify for the Name claim. Defaults to [NameIdentifier](https://learn.microsoft.com/dotnet/api/system.security.claims.claimtypes.nameidentifier). |
| `roleType`           | `string`                                                        | The ClaimType to specify for Role claims. Defaults to [Role](https://learn.microsoft.com/dotnet/api/system.security.claims.claimtypes.role).                        |

#### Remarks

This is used in non-ASP.NET Core testing situations where you're not going to pull the Identity from a request-specific DI Container.

### <Icon icon="thumbtack" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> SetClaimsPrincipalSelectorToThreadPrincipal

Sets the [ClaimsPrincipalSelector](https://learn.microsoft.com/dotnet/api/system.security.claims.claimsprincipal.claimsprincipalselector) to the [CurrentPrincipal](https://learn.microsoft.com/dotnet/api/system.threading.thread.currentprincipal) and sets the latter to a new ClaimsIdentity with the specified claim.

#### Syntax

```csharp theme={"dark"}
public static void SetClaimsPrincipalSelectorToThreadPrincipal(System.Security.Claims.Claim claim, string authenticationType = "BreakdanceTests", string nameType = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier", string roleType = "http://schemas.microsoft.com/ws/2008/06/identity/claims/role")
```

#### Parameters

| Name                 | Type                           | Description                                                                                                                                                         |
| -------------------- | ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `claim`              | `System.Security.Claims.Claim` | The Claims to set for the test run.                                                                                                                                 |
| `authenticationType` | `string`                       | If needed, the AuthenticationType of the ClaimsIdentity. Defaults to "BreakdanceTests".                                                                             |
| `nameType`           | `string`                       | The ClaimType to specify for the Name claim. Defaults to [NameIdentifier](https://learn.microsoft.com/dotnet/api/system.security.claims.claimtypes.nameidentifier). |
| `roleType`           | `string`                       | The ClaimType to specify for Role claims. Defaults to [Role](https://learn.microsoft.com/dotnet/api/system.security.claims.claimtypes.role).                        |

#### Remarks

This is used in non-ASP.NET Core testing situations where you're not going to pull the Identity from a request-specific DI Container.

### <Icon icon="thumbtack" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> SetThreadPrincipal

Sets the [ClaimsPrincipalSelector](https://learn.microsoft.com/dotnet/api/system.security.claims.claimsprincipal.claimsprincipalselector) to a new ClaimsIdentity with the specified claims.

#### Syntax

```csharp theme={"dark"}
public static void SetThreadPrincipal(System.Collections.Generic.List<System.Security.Claims.Claim> claims, string authenticationType = "BreakdanceTests", string nameType = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier", string roleType = "http://schemas.microsoft.com/ws/2008/06/identity/claims/role")
```

#### Parameters

| Name                 | Type                                                            | Description                                                                                                                                                         |
| -------------------- | --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `claims`             | `System.Collections.Generic.List<System.Security.Claims.Claim>` | The Claims to set for the test run.                                                                                                                                 |
| `authenticationType` | `string`                                                        | If needed, the AuthenticationType of the ClaimsIdentity. Defaults to "BreakdanceTests".                                                                             |
| `nameType`           | `string`                                                        | The ClaimType to specify for the Name claim. Defaults to [NameIdentifier](https://learn.microsoft.com/dotnet/api/system.security.claims.claimtypes.nameidentifier). |
| `roleType`           | `string`                                                        | The ClaimType to specify for Role claims. Defaults to [Role](https://learn.microsoft.com/dotnet/api/system.security.claims.claimtypes.role).                        |

#### Remarks

This is used in non-ASP.NET Core testing situations where you're not going to pull the Identity from a request-specific DI Container.

### <Icon icon="thumbtack" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> SetThreadPrincipal

Sets the [ClaimsPrincipalSelector](https://learn.microsoft.com/dotnet/api/system.security.claims.claimsprincipal.claimsprincipalselector) to a new ClaimsIdentity with the specified claim.

#### Syntax

```csharp theme={"dark"}
public static void SetThreadPrincipal(System.Security.Claims.Claim claim, string authenticationType = "BreakdanceTests", string nameType = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier", string roleType = "http://schemas.microsoft.com/ws/2008/06/identity/claims/role")
```

#### Parameters

| Name                 | Type                           | Description                                                                                                                                                         |
| -------------------- | ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `claim`              | `System.Security.Claims.Claim` | The Claims to set for the test run.                                                                                                                                 |
| `authenticationType` | `string`                       | If needed, the AuthenticationType of the ClaimsIdentity. Defaults to "BreakdanceTests".                                                                             |
| `nameType`           | `string`                       | The ClaimType to specify for the Name claim. Defaults to [NameIdentifier](https://learn.microsoft.com/dotnet/api/system.security.claims.claimtypes.nameidentifier). |
| `roleType`           | `string`                       | The ClaimType to specify for Role claims. Defaults to [Role](https://learn.microsoft.com/dotnet/api/system.security.claims.claimtypes.role).                        |

#### Remarks

This is used in non-ASP.NET Core testing situations where you're not going to pull the Identity from a request-specific DI Container.

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> TestSetup <Badge color="orange">Virtual</Badge>

Method used by test classes to setup the environment.

#### Syntax

```csharp theme={"dark"}
public virtual void TestSetup()
```

#### Remarks

With MSTest, use \[TestInitialize].
With NUnit, use \[Setup].
With xUnit, good luck: [https://xunit.net/docs/shared-context](https://xunit.net/docs/shared-context)
This method calls [BreakdanceTestBase.TestSetupAsync](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/BreakdanceTestBase#testsetupasync) synchronously.

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> TestSetupAsync <Badge color="orange">Virtual</Badge>

Method used by test classes to setup the environment asynchronously.

#### Syntax

```csharp theme={"dark"}
public virtual System.Threading.Tasks.Task TestSetupAsync()
```

#### Returns

Type: `System.Threading.Tasks.Task`

#### Remarks

With MSTest, use \[TestInitialize] with async Task return type.
With NUnit, use \[Setup] with async Task return type.
With xUnit, good luck: [https://xunit.net/docs/shared-context](https://xunit.net/docs/shared-context)

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> TestTearDown <Badge color="orange">Virtual</Badge>

Method used by test classes to clean up the environment.

#### Syntax

```csharp theme={"dark"}
public virtual void TestTearDown()
```

#### Remarks

With MSTest, use \[TestCleanup].
With NUnit, use \[TearDown].
With xUnit, good luck: [https://xunit.net/docs/shared-context](https://xunit.net/docs/shared-context)
This method calls [BreakdanceTestBase.TestTearDownAsync](/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/BreakdanceTestBase#testteardownasync) synchronously.

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> TestTearDownAsync <Badge color="orange">Virtual</Badge>

Method used by test classes to clean up the environment asynchronously.

#### Syntax

```csharp theme={"dark"}
public virtual System.Threading.Tasks.Task TestTearDownAsync()
```

#### Returns

Type: `System.Threading.Tasks.Task`

#### Remarks

With MSTest, use \[TestCleanup] with async Task return type.
With NUnit, use \[TearDown] with async Task return type.
With xUnit, good luck: [https://xunit.net/docs/shared-context](https://xunit.net/docs/shared-context)

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> ToString <Badge color="gray">Inherited</Badge> <Badge color="orange">Virtual</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
public virtual string ToString()
```

#### Returns

Type: `string?`

## Related APIs

* System.IDisposable
* System.IAsyncDisposable
