Skip to content

Commit

Permalink
add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
linkdotnet committed Nov 26, 2023
1 parent 5a6697e commit 584d57a
Showing 1 changed file with 11 additions and 3 deletions.
Expand Up @@ -164,10 +164,18 @@ static Predicate<Type> CreatePredicate(Type componentTypeToStub)

#if NET8_0_OR_GREATER
/// <summary>
/// TODO.
/// Marks a component as a stub component so that a stub gets generated for it. The stub has the same name as the component, but with the suffix "Stub" added.
/// </summary>
#pragma warning disable S2326
public static ComponentFactoryCollection AddGeneratedStub<TComponent>(this ComponentFactoryCollection factories) where TComponent : IComponent
/// <typeparam name="TComponent">The type of component to generate a stub for.</typeparam>
/// <remarks>
/// When <c>ComponentFactories.AddGeneratedStub&lt;MyButton&gt;()</c> is called, a stub component is generated for the component
/// with the name <c>MyButtonStub</c>. The stub component is added to the <see cref="ComponentFactoryCollection"/> and can be used.
/// It can also be retrieved via `cut.FindComponent&lt;MyButtonStub&gt;()`.
/// This call does the same as <c>ComponentFactories.Add&lt;MyButton, MyButtonStub&gt;()</c>.
/// </remarks>
#pragma warning disable S2326 // Unused type parameters should be removed - this is just the shape for the interceptor
public static ComponentFactoryCollection AddGeneratedStub<TComponent>(this ComponentFactoryCollection factories)
where TComponent : IComponent
#pragma warning restore S2326
{
if (factories is null)
Expand Down

0 comments on commit 584d57a

Please sign in to comment.