Documentation Index Fetch the complete documentation index at: https://easyaf.dev/llms.txt
Use this file to discover all available pages before exploring further.
Definition
Assembly: CloudNimble.Breakdance.Assemblies.dll
Namespace: CloudNimble.Breakdance.Assemblies
Inheritance: System.Object
Syntax
CloudNimble . Breakdance . Assemblies . BreakdanceTestBase
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
public BreakdanceTestBase ()
.ctor Inherited
Syntax
Properties
DefaultScope
Provides a default IServiceScope implementation to contain scoped services.
Syntax
public Microsoft . Extensions . DependencyInjection . IServiceScope DefaultScope { get ; set ; }
Property Value
Type: Microsoft.Extensions.DependencyInjection.IServiceScope
TestHost
The IHost instance containing the test host.
Syntax
public Microsoft . Extensions . Hosting . IHost TestHost { get ; internal set ; }
Property Value
Type: Microsoft.Extensions.Hosting.IHost
TestHostBuilder
The IHostBuilder instance used to configure the test host.
Syntax
public Microsoft . Extensions . Hosting . IHostBuilder TestHostBuilder { get ; internal set ; }
Property Value
Type: Microsoft.Extensions.Hosting.IHostBuilder
Methods
AssemblySetup Virtual
Method used by test assemblies to setup the environment.
Syntax
public virtual void AssemblySetup ()
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
public virtual System . Threading . Tasks . Task AssemblySetupAsync ()
Returns
Type: System.Threading.Tasks.Task
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
public virtual void AssemblyTearDown ()
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
public virtual System . Threading . Tasks . Task AssemblyTearDownAsync ()
Returns
Type: System.Threading.Tasks.Task
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
public virtual void ClassSetup ()
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
public virtual System . Threading . Tasks . Task ClassSetupAsync ()
Returns
Type: System.Threading.Tasks.Task
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
public virtual void ClassTearDown ()
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
public virtual System . Threading . Tasks . Task ClassTearDownAsync ()
Returns
Type: System.Threading.Tasks.Task
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
public System . Threading . Tasks . ValueTask DisposeAsync ()
Returns
Type: System.Threading.Tasks.ValueTask
Equals Inherited Virtual
Syntax
public virtual bool Equals ( object obj )
Parameters
Name Type Description objobject?-
Returns
Type: bool
Equals Inherited
Syntax
public static bool Equals ( object objA , object objB )
Parameters
Name Type Description objAobject?- objBobject?-
Returns
Type: bool
GetHashCode Inherited Virtual
Syntax
public virtual int GetHashCode ()
Returns
Type: int
GetKeyedService Virtual
Get service of type T from the System.IServiceProvider.
Syntax
public virtual T GetKeyedService < T >( string key ) where T : class
Parameters
Name Type Description keystringThe 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.
GetKeyedServices Virtual
Get services of type T from the System.IServiceProvider.
Syntax
public virtual System . Collections . Generic . IEnumerable < T > GetKeyedServices < T >( string key ) where T : class
Parameters
Name Type Description keystringThe
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
public T GetScopedService < T >( Microsoft . Extensions . DependencyInjection . IServiceScope scope ) where T : class
Parameters
Name Type Description scopeMicrosoft.Extensions.DependencyInjection.IServiceScope-
Returns
Type: T
Type Parameters
GetScopedService
Get the requested service from the default IServiceScope provided by Breakdance.
Syntax
public T GetScopedService < T >() where T : class
Returns
Type: T
Type Parameters
GetScopedServices
Get the requested service from the specified IServiceScope .
Syntax
public System . Collections . Generic . IEnumerable < T > GetScopedServices < T >( Microsoft . Extensions . DependencyInjection . IServiceScope scope ) where T : class
Parameters
Name Type Description scopeMicrosoft.Extensions.DependencyInjection.IServiceScope-
Returns
Type: System.Collections.Generic.IEnumerable<T>
Type Parameters
GetScopedServices
Get the requested service from the default IServiceScope provided by Breakdance.
Syntax
public System . Collections . Generic . IEnumerable < T > GetScopedServices < T >() where T : class
Returns
Type: System.Collections.Generic.IEnumerable<T>
Type Parameters
GetService Virtual
Get service of type T from the System.IServiceProvider.
Syntax
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.
GetServices Virtual
Get an enumeration of services of type T from the System.IServiceProvider.
Syntax
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.
GetType Inherited
Syntax
public System . Type GetType ()
Returns
Type: System.Type
MemberwiseClone Inherited
Syntax
protected internal object MemberwiseClone ()
Returns
Type: object
ReferenceEquals Inherited
Syntax
public static bool ReferenceEquals ( object objA , object objB )
Parameters
Name Type Description objAobject?- objBobject?-
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
public void ResetTestHostBuilder ()
SetClaimsPrincipalSelectorToThreadPrincipal
Sets the ClaimsPrincipalSelector to the CurrentPrincipal .
Syntax
public static void SetClaimsPrincipalSelectorToThreadPrincipal ()
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
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 claimsSystem.Collections.Generic.List<System.Security.Claims.Claim>The Claims to set for the test run. authenticationTypestringIf needed, the AuthenticationType of the ClaimsIdentity. Defaults to “BreakdanceTests”. nameTypestringThe ClaimType to specify for the Name claim. Defaults to NameIdentifier . roleTypestringThe ClaimType to specify for Role claims. Defaults to Role .
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
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 claimSystem.Security.Claims.ClaimThe Claims to set for the test run. authenticationTypestringIf needed, the AuthenticationType of the ClaimsIdentity. Defaults to “BreakdanceTests”. nameTypestringThe ClaimType to specify for the Name claim. Defaults to NameIdentifier . roleTypestringThe ClaimType to specify for Role claims. Defaults to Role .
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
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 claimsSystem.Collections.Generic.List<System.Security.Claims.Claim>The Claims to set for the test run. authenticationTypestringIf needed, the AuthenticationType of the ClaimsIdentity. Defaults to “BreakdanceTests”. nameTypestringThe ClaimType to specify for the Name claim. Defaults to NameIdentifier . roleTypestringThe ClaimType to specify for Role claims. Defaults to Role .
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
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 claimSystem.Security.Claims.ClaimThe Claims to set for the test run. authenticationTypestringIf needed, the AuthenticationType of the ClaimsIdentity. Defaults to “BreakdanceTests”. nameTypestringThe ClaimType to specify for the Name claim. Defaults to NameIdentifier . roleTypestringThe ClaimType to specify for Role claims. Defaults to Role .
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
public virtual void TestSetup ()
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
public virtual System . Threading . Tasks . Task TestSetupAsync ()
Returns
Type: System.Threading.Tasks.Task
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
public virtual void TestTearDown ()
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
public virtual System . Threading . Tasks . Task TestTearDownAsync ()
Returns
Type: System.Threading.Tasks.Task
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
Syntax
public virtual string ToString ()
Returns
Type: string?
System.IDisposable
System.IAsyncDisposable