Skip to content

Commit fafa45c

Browse files
committed
Tweaks to docs after merge with Packt edits
1 parent 1329198 commit fafa45c

4 files changed

Lines changed: 11 additions & 12 deletions

File tree

docs/samples/tests/razor/AllKindsOfParamsTest.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,13 @@
116116
</Fixture>
117117

118118

119-
120119
<Fixture Test="f => {}">
121120
<ComponentUnderTest>
122121
<UnmatchedParams some-unknown-param="a value" />
123122
</ComponentUnderTest>
124123
</Fixture>
125124

125+
126126
<Fixture Test="f => {}">
127127
<ComponentUnderTest>
128128
<CascadingValue Value="true"> @* isDarkMode *@

docs/samples/tests/xunit/AllKindsOfParamsTest.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
using Microsoft.AspNetCore.Components;
55
using Microsoft.AspNetCore.Components.Web;
66
using Bunit.Rendering;
7-
87
using static Bunit.ComponentParameterFactory;
98

109
namespace Bunit.Docs.Samples

docs/site/docs/providing-input/passing-parameters-to-components.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ Some times you need to pass multiple different types of content to a `RenderFrag
267267
268268
# [C# test code](#tab/csharp)
269269
270-
[!code-csharp[](../../../samples/tests/xunit/AllKindsOfParamsTest.cs#L208-L227)]
270+
[!code-csharp[](../../../samples/tests/xunit/AllKindsOfParamsTest.cs#L208-L228)]
271271
272272
Passing a mix of markup and components to a `RenderFragment` parameter is simply done by calling the <xref:Bunit.ComponentParameterCollectionBuilder`1>'s `Add()` methods or using the `ChildContent()` factory methods in <xref:Bunit.ComponentParameterFactory>, as seen here.
273273
@@ -304,7 +304,7 @@ The delegate creates a simple markup string in both examples.
304304
305305
# [Razor test code](#tab/razor)
306306
307-
[!code-cshtml[](../../../samples/tests/razor/AllKindsOfParamsTest.razor#L98-L109)]
307+
[!code-cshtml[](../../../samples/tests/razor/AllKindsOfParamsTest.razor#L98-L106)]
308308
309309
This is just regular Blazor `RenderFragment<TValue>` parameter passing, in this case, to the `Template` parameter. This is the same for both `Fixture` and `SnapshotTest` razor tests.
310310
@@ -318,13 +318,13 @@ To pass a template into a `RenderFragment<TValue>` parameter, which is based on
318318
319319
# [C# test code](#tab/csharp)
320320
321-
[!code-csharp[](../../../samples/tests/xunit/AllKindsOfParamsTest.cs#L253-L269)]
321+
[!code-csharp[](../../../samples/tests/xunit/AllKindsOfParamsTest.cs#L252-L268)]
322322
323323
These examples do the same thing, i.e. create a template with the `<Item>` component listed above.
324324
325325
# [Razor test code](#tab/razor)
326326
327-
[!code-cshtml[](../../../samples/tests/razor/AllKindsOfParamsTest.razor#L108-L118)]
327+
[!code-cshtml[](../../../samples/tests/razor/AllKindsOfParamsTest.razor#L108-L116)]
328328
329329
This is just regular Blazor `RenderFragment<TValue>` parameter passing, in this case, to the `Template` parameter. This is the same for both `Fixture` and `SnapshotTest` razor tests.
330330
@@ -340,13 +340,13 @@ In the follow examples, we will pass an unmatched parameter to the following com
340340
341341
# [C# test code](#tab/csharp)
342342
343-
[!code-csharp[](../../../samples/tests/xunit/AllKindsOfParamsTest.cs#L275-L285)]
343+
[!code-csharp[](../../../samples/tests/xunit/AllKindsOfParamsTest.cs#L274-L284)]
344344
345345
These examples do the same thing, i.e. pass in the parameter `some-unknown-param` with the value `a value` to the component under test.
346346
347347
# [Razor test code](#tab/razor)
348348
349-
[!code-cshtml[](../../../samples/tests/razor/AllKindsOfParamsTest.razor#L120-L124)]
349+
[!code-cshtml[](../../../samples/tests/razor/AllKindsOfParamsTest.razor#L119-L123)]
350350
351351
This is just regular Blazor parameter passing, which is the same for both `Fixture` and `SnapshotTest` razor tests. In this case, the parameter `some-unknown-param` with the value `a value` is passed to the component under test.
352352
@@ -366,7 +366,7 @@ To pass the unnamed `IsDarkTheme` cascading parameter to the `<CascadingParams>`
366366
367367
# [C# test code](#tab/csharp)
368368
369-
[!code-csharp[](../../../samples/tests/xunit/AllKindsOfParamsTest.cs#L291-L307)]
369+
[!code-csharp[](../../../samples/tests/xunit/AllKindsOfParamsTest.cs#L290-L306)]
370370
371371
These examples do the same thing, i.e. passing the variable `isDarkTheme` to the cascading parameter `IsDarkTheme`.
372372
@@ -388,7 +388,7 @@ To pass a named cascading parameter to the `<CascadingParams>` component, do the
388388
389389
# [C# test code](#tab/csharp)
390390
391-
[!code-csharp[](../../../samples/tests/xunit/AllKindsOfParamsTest.cs#L313-L323)]
391+
[!code-csharp[](../../../samples/tests/xunit/AllKindsOfParamsTest.cs#L312-L322)]
392392
393393
These examples do the same thing, i.e. pass in value `Egil Hansen` to the cascading parameter with the name `LoggedInUser`. Note that the name of the parameter is not the same as the property of the parameter, e.g. `LoggedInUser` vs. `UserName`.
394394
@@ -409,7 +409,7 @@ To pass all cascading parameters to the `<CascadingParams>` component, do the fo
409409
410410
# [C# test code](#tab/csharp)
411411
412-
[!code-csharp[](../../../samples/tests/xunit/AllKindsOfParamsTest.cs#L329-L351)]
412+
[!code-csharp[](../../../samples/tests/xunit/AllKindsOfParamsTest.cs#L328-L350)]
413413
414414
These examples do the same thing, i.e. passing both the unnamed `IsDarkTheme` cascading parameter and the two named cascading parameters (`LoggedInUser`, `LoggedInEmail`).
415415

docs/site/templates/bunit/partials/affix.tmpl.partial

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<a href="https://www.packtpub.com/" title="Packt">
1616
<img width="150" src="/sponsors/packt-retina-logo.png" />
1717
</a>
18-
<p>Editorial support provided by <a href="https://www.packtpub.com/" title="Packt">Packt!</a></p>
18+
<p>Editorial support provided by <a href="https://www.packtpub.com/" title="Packt">Packt</a>.</p>
1919
</div>
2020
{{^_disableContribution}}
2121
<div class="contribution">

0 commit comments

Comments
 (0)