Class StubComponentFactoryCollectionExtensions
- Namespace
- Bunit
- Assembly
- Bunit.Web.dll
Extension methods for using component doubles.
public static class StubComponentFactoryCollectionExtensions
- Inheritance
-
StubComponentFactoryCollectionExtensions
- Inherited Members
Methods
AddStub(ComponentFactoryCollection, Predicate<Type>)
Configures bUnit to use replace all components whose type make the componentTypePredicate
predicate return true
with a Stub<TComponent> component in the render tree.
public static ComponentFactoryCollection AddStub(this ComponentFactoryCollection factories, Predicate<Type> componentTypePredicate)
Parameters
factories
ComponentFactoryCollectionThe bUnit ComponentFactoryCollection to configure.
componentTypePredicate
Predicate<Type>The predicate which decides if a component should be replaced with a Stub<TComponent> component.
Returns
AddStub(ComponentFactoryCollection, Predicate<Type>, RenderFragment)
Configures bUnit to use replace all components whose type make the componentTypePredicate
predicate return true
with a Stub<TComponent> component in the render tree.
public static ComponentFactoryCollection AddStub(this ComponentFactoryCollection factories, Predicate<Type> componentTypePredicate, RenderFragment replacementFragment)
Parameters
factories
ComponentFactoryCollectionThe bUnit ComponentFactoryCollection to configure.
componentTypePredicate
Predicate<Type>The predicate which decides if a component should be replaced with a Stub<TComponent> component.
replacementFragment
RenderFragmentReplacement RenderFragment that will be used to render output instead of the stubbed out components.
Returns
AddStub(ComponentFactoryCollection, Predicate<Type>, string)
Configures bUnit to use replace all components whose type make the componentTypePredicate
predicate return true
with a Stub<TComponent> component in the render tree.
public static ComponentFactoryCollection AddStub(this ComponentFactoryCollection factories, Predicate<Type> componentTypePredicate, string replacementMarkup)
Parameters
factories
ComponentFactoryCollectionThe bUnit ComponentFactoryCollection to configure.
componentTypePredicate
Predicate<Type>The predicate which decides if a component should be replaced with a Stub<TComponent> component.
replacementMarkup
stringReplacement markup that will be used to render output instead of the stubbed out components.
Returns
AddStub<TComponent>(ComponentFactoryCollection)
Configures bUnit to use replace all components of type TComponent
(including derived components)
with a Stub<TComponent> component in the render tree.
public static ComponentFactoryCollection AddStub<TComponent>(this ComponentFactoryCollection factories) where TComponent : IComponent
Parameters
factories
ComponentFactoryCollectionThe bUnit ComponentFactoryCollection to configure.
Returns
Type Parameters
TComponent
The type of component to replace with a Stub<TComponent> component.
Remarks
NOTE: This will replace any component of type TComponent
or components that derives/inherits from it.
AddStub<TComponent>(ComponentFactoryCollection, RenderFragment)
Configures bUnit to use replace all components of type TComponent
(including derived components)
with a Stub<TComponent> component in the render tree.
public static ComponentFactoryCollection AddStub<TComponent>(this ComponentFactoryCollection factories, RenderFragment replacementFragment) where TComponent : IComponent
Parameters
factories
ComponentFactoryCollectionThe bUnit ComponentFactoryCollection to configure.
replacementFragment
RenderFragmentReplacement render fragment that will be used as render output instead of the stubbed out component.
Returns
Type Parameters
TComponent
The type of component to replace with a Stub<TComponent> component.
Remarks
NOTE: This will replace any component of type TComponent
or components that derives/inherits from it.
AddStub<TComponent>(ComponentFactoryCollection, RenderFragment<CapturedParameterView<TComponent>>)
Configures bUnit to use replace all components of type TComponent
(including derived components)
with a Stub<TComponent> component in the render tree.
public static ComponentFactoryCollection AddStub<TComponent>(this ComponentFactoryCollection factories, RenderFragment<CapturedParameterView<TComponent>> replacementTemplate) where TComponent : IComponent
Parameters
factories
ComponentFactoryCollectionThe bUnit ComponentFactoryCollection to configure.
replacementTemplate
RenderFragment<CapturedParameterView<TComponent>>Replacement template that will be used to render output instead of the stubbed out component.
Returns
Type Parameters
TComponent
The type of component to replace with a Stub<TComponent> component.
Remarks
NOTE: This will replace any component of type TComponent
or components that derives/inherits from it.
AddStub<TComponent>(ComponentFactoryCollection, Func<CapturedParameterView<TComponent>, string>)
Configures bUnit to use replace all components of type TComponent
(including derived components)
with a Stub<TComponent> component in the render tree.
public static ComponentFactoryCollection AddStub<TComponent>(this ComponentFactoryCollection factories, Func<CapturedParameterView<TComponent>, string> replacementTemplate) where TComponent : IComponent
Parameters
factories
ComponentFactoryCollectionThe bUnit ComponentFactoryCollection to configure.
replacementTemplate
Func<CapturedParameterView<TComponent>, string>Replacement template that will be used to render output instead of the stubbed out component.
Returns
Type Parameters
TComponent
The type of component to replace with a Stub<TComponent> component.
Remarks
NOTE: This will replace any component of type TComponent
or components that derives/inherits from it.
AddStub<TComponent>(ComponentFactoryCollection, string)
Configures bUnit to use replace all components of type TComponent
(including derived components)
with a Stub<TComponent> component in the render tree.
public static ComponentFactoryCollection AddStub<TComponent>(this ComponentFactoryCollection factories, string replacementMarkup) where TComponent : IComponent
Parameters
factories
ComponentFactoryCollectionThe bUnit ComponentFactoryCollection to configure.
replacementMarkup
stringMarkup that will be used as render output instead of the stubbed out component.
Returns
Type Parameters
TComponent
The type of component to replace with a Stub<TComponent> component.
Remarks
NOTE: This will replace any component of type TComponent
or components that derives/inherits from it.