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
factoriesComponentFactoryCollectionThe bUnit ComponentFactoryCollection to configure.
componentTypePredicatePredicate<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
factoriesComponentFactoryCollectionThe bUnit ComponentFactoryCollection to configure.
componentTypePredicatePredicate<Type>The predicate which decides if a component should be replaced with a Stub<TComponent> component.
replacementFragmentRenderFragmentReplacement 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
factoriesComponentFactoryCollectionThe bUnit ComponentFactoryCollection to configure.
componentTypePredicatePredicate<Type>The predicate which decides if a component should be replaced with a Stub<TComponent> component.
replacementMarkupstringReplacement 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
factoriesComponentFactoryCollectionThe bUnit ComponentFactoryCollection to configure.
Returns
Type Parameters
TComponentThe 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
factoriesComponentFactoryCollectionThe bUnit ComponentFactoryCollection to configure.
replacementFragmentRenderFragmentReplacement render fragment that will be used as render output instead of the stubbed out component.
Returns
Type Parameters
TComponentThe 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
factoriesComponentFactoryCollectionThe bUnit ComponentFactoryCollection to configure.
replacementTemplateRenderFragment<CapturedParameterView<TComponent>>Replacement template that will be used to render output instead of the stubbed out component.
Returns
Type Parameters
TComponentThe 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
factoriesComponentFactoryCollectionThe bUnit ComponentFactoryCollection to configure.
replacementTemplateFunc<CapturedParameterView<TComponent>, string>Replacement template that will be used to render output instead of the stubbed out component.
Returns
Type Parameters
TComponentThe 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
factoriesComponentFactoryCollectionThe bUnit ComponentFactoryCollection to configure.
replacementMarkupstringMarkup that will be used as render output instead of the stubbed out component.
Returns
Type Parameters
TComponentThe 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.