From dbe947efec4738e68cb0573cd03cbe2852abd04b Mon Sep 17 00:00:00 2001 From: Steven Giesel Date: Sun, 26 Nov 2023 21:58:22 +0100 Subject: [PATCH] add documentation --- .../StubComponentFactoryCollectionExtensions.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/bunit.web/Extensions/StubComponentFactoryCollectionExtensions.cs b/src/bunit.web/Extensions/StubComponentFactoryCollectionExtensions.cs index 9dac7e10f..f2b81faf8 100644 --- a/src/bunit.web/Extensions/StubComponentFactoryCollectionExtensions.cs +++ b/src/bunit.web/Extensions/StubComponentFactoryCollectionExtensions.cs @@ -164,10 +164,18 @@ public static ComponentFactoryCollection AddStub( #if NET8_0_OR_GREATER /// - /// 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. /// + /// The type of component to generate a stub for. + /// + /// When ComponentFactories.AddGeneratedStub<MyButton>() is called, a stub component is generated for the component + /// with the name MyButtonStub. The stub component is added to the and can be used. + /// It can also be retrieved via `cut.FindComponent<MyButtonStub>()`. + /// This call does the same as ComponentFactories.Add<MyButton, MyButtonStub>(). + /// #pragma warning disable S2326 - public static ComponentFactoryCollection AddGeneratedStub(this ComponentFactoryCollection factories) where TComponent : IComponent + public static ComponentFactoryCollection AddGeneratedStub(this ComponentFactoryCollection factories) + where TComponent : IComponent #pragma warning restore S2326 { if (factories is null)