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

# BlazorBreakdanceTestBase

> A base class for building BUnit unit tests for Blazor apps that automatically handles basic registration stuff for you.

## Definition

**Assembly:** CloudNimble.Breakdance.Blazor.dll

**Namespace:** CloudNimble.Breakdance.Blazor

**Inheritance:** CloudNimble.Breakdance.Assemblies.BreakdanceTestBase

## Syntax

```csharp theme={"dark"}
CloudNimble.Breakdance.Blazor.BlazorBreakdanceTestBase
```

## Summary

A base class for building BUnit unit tests for Blazor apps that automatically handles basic registration stuff for you.

## Constructors

### &#x20;.ctor

#### Syntax

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

## Properties

### &#x20;BUnitTestContext

The bUnit `BunitContext` for the currently-executing test.

#### Syntax

```csharp theme={"dark"}
public Bunit.BunitContext BUnitTestContext { get; set; }
```

#### Property Value

Type: `Bunit.BunitContext`

## Methods

### &#x20;GetService Override

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

#### Syntax

```csharp theme={"dark"}
public override 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.

### &#x20;GetServices Override

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

#### Syntax

```csharp theme={"dark"}
public override 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.

### &#x20;TestSetup Override

Properly instantiates the [BlazorBreakdanceTestBase.BUnitTestContext](https://easyaf.nimbleapps.cloud/breakdance/api-reference/CloudNimble/Breakdance/Blazor/BlazorBreakdanceTestBase.md#bunittestcontext) and registers the [BreakdanceTestBase.TestHost](https://easyaf.nimbleapps.cloud/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/BreakdanceTestBase.md#testhost)TestHost's\</see>[Services](https://learn.microsoft.com/dotnet/api/microsoft.extensions.hosting.ihost.services) as a "fallback" [IServiceProvider](https://easyaf.nimbleapps.cloud/breakdance/api-reference/System/IServiceProvider.md).

#### Syntax

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

### &#x20;TestSetup

Properly instantiates the [BlazorBreakdanceTestBase.BUnitTestContext](https://easyaf.nimbleapps.cloud/breakdance/api-reference/CloudNimble/Breakdance/Blazor/BlazorBreakdanceTestBase.md#bunittestcontext) and registers the [BreakdanceTestBase.TestHost](https://easyaf.nimbleapps.cloud/breakdance/api-reference/CloudNimble/Breakdance/Assemblies/BreakdanceTestBase.md#testhost)TestHost's\</see>[Services](https://learn.microsoft.com/dotnet/api/microsoft.extensions.hosting.ihost.services) as a "fallback" [IServiceProvider](https://easyaf.nimbleapps.cloud/breakdance/api-reference/System/IServiceProvider.md) and allows you to set the bUnit JSInterop mode.

#### Syntax

```csharp theme={"dark"}
public void TestSetup(Bunit.JSRuntimeMode jSRuntimeMode)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `jSRuntimeMode` | `Bunit.JSRuntimeMode` | - |

### &#x20;TestTearDown Override

Disposes of the [BlazorBreakdanceTestBase.BUnitTestContext](https://easyaf.nimbleapps.cloud/breakdance/api-reference/CloudNimble/Breakdance/Blazor/BlazorBreakdanceTestBase.md#bunittestcontext).

#### Syntax

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


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.