diff --git a/docs/site/docs/providing-input/substituting-components.md b/docs/site/docs/providing-input/substituting-components.md index d2fa75511..2d38c191b 100644 --- a/docs/site/docs/providing-input/substituting-components.md +++ b/docs/site/docs/providing-input/substituting-components.md @@ -76,7 +76,7 @@ ctx.ComponentFactories.AddStub("
NOT FROM BAR
"); // Add the markup specified in the render fragment to the rendered // output instead of that from . -ctx.ComponentFactories.AddStub(@div>NOT FROM BAR); +ctx.ComponentFactories.AddStub(@
NOT FROM BAR
); ``` It is also possible to access the parameter that is passed to the substituted component, both when specifying alternative render output or when verifying the correct parameters was passed to the substituted component. For example, suppose `` has a parameter named `Baz`: @@ -88,7 +88,7 @@ ctx.ComponentFactories.AddStub(parameters => $"
{parameters.Get(x => Ba // Add the markup produced by the render template to the rendered // output instead of that from . -ctx.ComponentFactories.AddStub(parameters => @div>@(parameters.Get(x => Baz))
); +ctx.ComponentFactories.AddStub(parameters => @
@(parameters.Get(x => Baz))
); ``` To verify that the expected value was passed to the `Baz` parameter of ``, first find the substituted component in the render tree using the `FindComponent`/`FindComponents` methods, and then inspect the `Parameters` property. E.g.: @@ -136,7 +136,7 @@ ctx.ComponentFactories.AddStub(type => type.Namespace == "Third.Party.Lib", // Add the markup produced by the render fragment to the rendered // output instead of the components that match the predicate. ctx.ComponentFactories.AddStub(type => type.Namespace == "Third.Party.Lib", - @div>NOT FROM BAR); + @
NOT FROM BAR
); ``` ### Creating a mock component with mocking libraries