Skip to main content

Definition

Assembly: CloudNimble.Breakdance.Blazor.dll Namespace: CloudNimble.Breakdance.Blazor Inheritance: CloudNimble.Breakdance.Assemblies.BreakdanceTestBase

Syntax

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

.ctor

Syntax

public BlazorBreakdanceTestBase()

Properties

BUnitTestContext

The bUnit TestContext for the currently-executing test.

Syntax

public Bunit.TestContext BUnitTestContext { get; set; }

Property Value

Type: Bunit.TestContext

Methods

GetService Override

Get service of type T from the System.IServiceProvider.

Syntax

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.

GetServices Override

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

Syntax

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.

TestSetup Override

Properly instantiates the BlazorBreakdanceTestBase.BUnitTestContext and registers the BreakdanceTestBase.TestHostTestHost’s</see>Services as a “fallback” IServiceProvider.

Syntax

public override void TestSetup()

TestSetup

Properly instantiates the BlazorBreakdanceTestBase.BUnitTestContext and registers the BreakdanceTestBase.TestHostTestHost’s</see>Services as a “fallback” IServiceProvider and allows you to set the bUnit JSInterop mode.

Syntax

public void TestSetup(Bunit.JSRuntimeMode jSRuntimeMode)

Parameters

NameTypeDescription
jSRuntimeModeBunit.JSRuntimeMode-

TestTearDown Override

Disposes of the BlazorBreakdanceTestBase.BUnitTestContext.

Syntax

public override void TestTearDown()