Skip to main content

Definition

Assembly: CloudNimble.Breakdance.Assemblies.dll Namespace: CloudNimble.Breakdance.Assemblies Inheritance: System.Object

Syntax

Summary

A base class for unit tests that maintains an IHost with configuration and a Dependency Injection container.

Constructors

.ctor

Creates a new BreakdanceTestBase instance.

Syntax

.ctor Inherited

Inherited from object

Syntax

Properties

DefaultScope

Provides a default IServiceScope implementation to contain scoped services.

Syntax

Property Value

Type: Microsoft.Extensions.DependencyInjection.IServiceScope

TestHost

The IHost instance containing the test host.

Syntax

Property Value

Type: Microsoft.Extensions.Hosting.IHost

TestHostBuilder

The IHostBuilder instance used to configure the test host.

Syntax

Property Value

Type: Microsoft.Extensions.Hosting.IHostBuilder

Methods

AssemblySetup Virtual

Method used by test assemblies to setup the environment.

Syntax

Remarks

With MSTest, use [AssemblyInitialize]. With NUnit, use [OneTimeSetup]. With xUnit, good luck: https://xunit.net/docs/shared-context This method calls BreakdanceTestBase.AssemblySetupAsync synchronously.

AssemblySetupAsync Virtual

Method used by test assemblies to setup the environment asynchronously.

Syntax

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

AssemblyTearDown Virtual

Method used by test assemblies to clean up the environment.

Syntax

Remarks

With MSTest, use [AssemblyCleanup]. With NUnit, use [OneTimeTearDown]. With xUnit, good luck: https://xunit.net/docs/shared-context This method calls BreakdanceTestBase.AssemblyTearDownAsync synchronously.

AssemblyTearDownAsync Virtual

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

Syntax

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

ClassSetup Virtual

Method used by test classes to setup the environment.

Syntax

Remarks

With MSTest, use [ClassInitialize]. With NUnit, use [OneTimeSetup]. With xUnit, good luck: https://xunit.net/docs/shared-context This method calls BreakdanceTestBase.ClassSetupAsync synchronously.

ClassSetupAsync Virtual

Method used by test classes to setup the environment asynchronously.

Syntax

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

ClassTearDown Virtual

Method used by test classes to clean up the environment.

Syntax

Remarks

With MSTest, use [ClassCleanup]. With NUnit, use [OneTimeTearDown]. With xUnit, good luck: https://xunit.net/docs/shared-context This method calls BreakdanceTestBase.ClassTearDownAsync synchronously.

ClassTearDownAsync Virtual

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

Syntax

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

Dispose

Clean up disposable objects in the environment.

Syntax

DisposeAsync

Asynchronously clean up disposable objects in the environment.

Syntax

Returns

Type: System.Threading.Tasks.ValueTask

Equals Inherited Virtual

Inherited from object

Syntax

Parameters

Returns

Type: bool

Equals Inherited

Inherited from object

Syntax

Parameters

Returns

Type: bool

GetHashCode Inherited Virtual

Inherited from object

Syntax

Returns

Type: int

GetKeyedService Virtual

Get service of type T from the System.IServiceProvider.

Syntax

Parameters

Returns

Type: T A service object of type T.

Type Parameters

  • T - The type of service object to get.

GetKeyedServices Virtual

Get services of type T from the System.IServiceProvider.

Syntax

Parameters

Returns

Type: System.Collections.Generic.IEnumerable<T> An IEnumerable`1 of type T.

Type Parameters

  • T - The type of service object to get.

GetScopedService

Get the requested service from the specified IServiceScope.

Syntax

Parameters

Returns

Type: T

Type Parameters

  • T -

GetScopedService

Get the requested service from the default IServiceScope provided by Breakdance.

Syntax

Returns

Type: T

Type Parameters

  • T -

GetScopedServices

Get the requested service from the specified IServiceScope.

Syntax

Parameters

Returns

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

Type Parameters

  • T -

GetScopedServices

Get the requested service from the default IServiceScope provided by Breakdance.

Syntax

Returns

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

Type Parameters

  • T -

GetService Virtual

Get service of type T from the System.IServiceProvider.

Syntax

Returns

Type: T A service object of type T.

Type Parameters

  • T - The type of service object to get.

GetServices Virtual

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

Syntax

Returns

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

Type Parameters

  • T - The type of service object to get.

GetType Inherited

Inherited from object

Syntax

Returns

Type: System.Type

MemberwiseClone Inherited

Inherited from object

Syntax

Returns

Type: object

ReferenceEquals Inherited

Inherited from object

Syntax

Parameters

Returns

Type: bool

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

SetClaimsPrincipalSelectorToThreadPrincipal

Sets the ClaimsPrincipalSelector to the CurrentPrincipal.

Syntax

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.

SetClaimsPrincipalSelectorToThreadPrincipal

Sets the ClaimsPrincipalSelector to the CurrentPrincipal and sets the latter to a new ClaimsIdentity with the specified claims.

Syntax

Parameters

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.

SetClaimsPrincipalSelectorToThreadPrincipal

Sets the ClaimsPrincipalSelector to the CurrentPrincipal and sets the latter to a new ClaimsIdentity with the specified claim.

Syntax

Parameters

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.

SetThreadPrincipal

Sets the ClaimsPrincipalSelector to a new ClaimsIdentity with the specified claims.

Syntax

Parameters

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.

SetThreadPrincipal

Sets the ClaimsPrincipalSelector to a new ClaimsIdentity with the specified claim.

Syntax

Parameters

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.

TestSetup Virtual

Method used by test classes to setup the environment.

Syntax

Remarks

With MSTest, use [TestInitialize]. With NUnit, use [Setup]. With xUnit, good luck: https://xunit.net/docs/shared-context This method calls BreakdanceTestBase.TestSetupAsync synchronously.

TestSetupAsync Virtual

Method used by test classes to setup the environment asynchronously.

Syntax

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

TestTearDown Virtual

Method used by test classes to clean up the environment.

Syntax

Remarks

With MSTest, use [TestCleanup]. With NUnit, use [TearDown]. With xUnit, good luck: https://xunit.net/docs/shared-context This method calls BreakdanceTestBase.TestTearDownAsync synchronously.

TestTearDownAsync Virtual

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

Syntax

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

ToString Inherited Virtual

Inherited from object

Syntax

Returns

Type: string?
  • System.IDisposable
  • System.IAsyncDisposable