> ## Documentation Index
> Fetch the complete documentation index at: https://easyaf.dev/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

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

#### Syntax

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

## Properties

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> 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

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

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.

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

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.

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

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

#### Syntax

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

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

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

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

Disposes of the [BlazorBreakdanceTestBase.BUnitTestContext](/breakdance/api-reference/CloudNimble/Breakdance/Blazor/BlazorBreakdanceTestBase#bunittestcontext).

#### Syntax

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