Skip to content

Commit 8a21a18

Browse files
committed
refactor: fixed typos in code and documentation
#closes #872 commit 3e4b1bb2f420edd43efceef497d125e41920e315 Author: Egil Hansen <egil@assimilated.dk> Date: Thu Jul 7 16:39:13 2022 +0000 spelling in JSRuntimeUnhandledInvocationExceptionTest commit 68bb875 Merge: cdfbce2 494c2fc Author: Egil Hansen <egil@assimilated.dk> Date: Thu Jul 7 16:35:46 2022 +0000 Merge branch 'main' into typos commit cdfbce2 Merge: 11fbab2 8cf4943 Author: Egil Hansen <egil@assimilated.dk> Date: Tue Jul 5 09:23:22 2022 +0000 Merge branch 'main' into typos commit 11fbab2 Author: Simon Cropp <simon.cropp@gmail.com> Date: Mon Jul 4 10:45:01 2022 +1000 . commit 87e1971 Author: Simon Cropp <simon.cropp@gmail.com> Date: Thu Jun 30 06:30:53 2022 +1000 Update ParameterException.cs commit 56e3c60 Merge: 799820b 41e3308 Author: Steven Giesel <stgiesel35@gmail.com> Date: Wed Jun 29 18:22:47 2022 +0200 Merge branch 'main' into typos commit 799820b Author: Simon Cropp <simon.cropp@gmail.com> Date: Wed Jun 29 19:40:30 2022 +1000 Update ParameterException.cs commit d52ee4e Author: Simon Cropp <simon.cropp@gmail.com> Date: Wed Jun 29 13:47:47 2022 +1000 typos
1 parent 494c2fc commit 8a21a18

18 files changed

Lines changed: 80 additions & 84 deletions

File tree

src/bunit.core/ComponentParameterCollection.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,13 +213,13 @@ public IEnumerator<ComponentParameter> GetEnumerator()
213213
/// <inheritdoc/>
214214
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() => GetEnumerator();
215215

216-
private static object WrapTemplates(Type templateParamterType, ComponentParameter[] templateParameters)
216+
private static object WrapTemplates(Type templateParameterType, ComponentParameter[] templateParameters)
217217
{
218218
// gets the generic argument to RenderFragment<>, e.g. string with RenderFragment<string>
219-
var templateType = templateParamterType.GetGenericArguments()[0];
219+
var templateType = templateParameterType.GetGenericArguments()[0];
220220

221221
// this creates an invokable version of CreateTemplateWrapper with the
222-
// generic type set to tmeplateType, e.g. CreateTemplateWrapper<string>
222+
// generic type set to templateType, e.g. CreateTemplateWrapper<string>
223223
var templateWrapper = CreateTemplateWrapperMethod.MakeGenericMethod(templateType);
224224

225225
// BANG: since CreateTemplateWrapper<T> will never return null BANG (!) is safe here

src/bunit.core/Extensions/ComponentFactoryCollectionExtensions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ namespace Bunit;
88
/// </summary>
99
public static class ComponentFactoryCollectionExtensions
1010
{
11-
/// <summary>
12-
/// Configures bUunit to substitute all components of type <typeparamref name="TComponent"/>
11+
/// <summary>
12+
/// Configures bUnit to substitute all components of type <typeparamref name="TComponent"/>
1313
/// with components of type <typeparamref name="TSubstituteComponent"/>.
1414
/// </summary>
1515
/// <typeparam name="TComponent">Type of component to replace.</typeparam>
@@ -81,7 +81,7 @@ public static ComponentFactoryCollection Add<TComponent>(this ComponentFactoryCo
8181
}
8282

8383
/// <summary>
84-
/// Configures bUnit to substitute components whose type matches the <paramref name="condition"/>,
84+
/// Configures bUnit to substitute components whose type matches the <paramref name="condition"/>,
8585
/// with components created by the provided component <paramref name="factory"/>.
8686
/// </summary>
8787
/// <remarks>

src/bunit.core/Extensions/WaitForHelpers/WaitForHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ private Task<T> CreateWaitTask(IRenderedFragmentBase renderedFragment, TimeSpan?
111111

112112
// Two to failure conditions, that the renderer captures an unhandled
113113
// exception from a component or itself, or that the timeout is reached,
114-
// are executed on the renderes schedular, to ensure that OnAfterRender
114+
// are executed on the renderes scheduler, to ensure that OnAfterRender
115115
// and the continuations does not happen at the same time.
116116
var failureTask = renderer.Dispatcher.InvokeAsync(() =>
117117
{

src/bunit.web/JSInterop/InvocationHandlers/Implementation/JSObjectReferenceInvocationHandler.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
#if NET5_0_OR_GREATER
2-
using System.Diagnostics.CodeAnalysis;
3-
using Microsoft.JSInterop;
42

53
namespace Bunit.JSInterop.InvocationHandlers.Implementation;
64

@@ -19,7 +17,7 @@ internal sealed class JSObjectReferenceInvocationHandler : JSRuntimeInvocationHa
1917
/// <summary>
2018
/// Initializes a new instance of the <see cref="JSObjectReferenceInvocationHandler"/> class.
2119
/// </summary>
22-
[SuppressMessage("Reliability", "CA2000:Dispose objects before losing scope", Justification = "BunitJSObjectReference doesn't have any disposable ressources, it just implements the methods to be compatible with the interfaces it implements.")]
20+
[SuppressMessage("Reliability", "CA2000:Dispose objects before losing scope", Justification = "BunitJSObjectReference doesn't have any disposable resources, it just implements the methods to be compatible with the interfaces it implements.")]
2321
public JSObjectReferenceInvocationHandler(BunitJSInterop parent, InvocationMatcher invocationMatcher, bool isCatchAllHandler)
2422
: base(invocationMatcher, isCatchAllHandler)
2523
{

src/bunit.web/JSInterop/InvocationHandlers/Implementation/LooseModeJSObjectReferenceInvocationHandler.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
#if NET5_0_OR_GREATER
2-
using System.Diagnostics.CodeAnalysis;
3-
using Microsoft.JSInterop;
42

53
namespace Bunit.JSInterop.InvocationHandlers.Implementation;
64

@@ -10,7 +8,7 @@ namespace Bunit.JSInterop.InvocationHandlers.Implementation;
108
/// </summary>
119
internal sealed class LooseModeJSObjectReferenceInvocationHandler : JSRuntimeInvocationHandler<IJSObjectReference>
1210
{
13-
[SuppressMessage("Reliability", "CA2000:Dispose objects before losing scope", Justification = "BunitJSObjectReference doesn't have any disposable ressources, it just implements the methods to be compatible with the interfaces it implements.")]
11+
[SuppressMessage("Reliability", "CA2000:Dispose objects before losing scope", Justification = "BunitJSObjectReference doesn't have any disposable resources, it just implements the methods to be compatible with the interfaces it implements.")]
1412
internal LooseModeJSObjectReferenceInvocationHandler(BunitJSInterop parent)
1513
: base(_ => parent.Mode == JSRuntimeMode.Loose, isCatchAllHandler: true)
1614
{

src/bunit.web/Rendering/RenderedComponent.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ internal RenderedComponent(int componentId, TComponent instance, RenderTreeFrame
3030
protected override void OnRender(RenderEvent renderEvent)
3131
{
3232
// checks if this is the first render, and if it is
33-
// tries to find the TCompoent in the render event
33+
// tries to find the TComponent in the render event
3434
if (instance is null)
3535
{
3636
SetComponentAndID(renderEvent);

tests/bunit.core.tests/Rendering/TestRendererTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ public TestRendererTest(ITestOutputHelper outputHelper)
1515
public void Test004()
1616
{
1717
var sut = Services.GetRequiredService<ITestRenderer>();
18-
RenderFragment thowingFragment = b => { b.OpenComponent<ThrowsDuringSetParams>(0); b.CloseComponent(); };
18+
RenderFragment throwingFragment = b => { b.OpenComponent<ThrowsDuringSetParams>(0); b.CloseComponent(); };
1919

20-
Should.Throw<InvalidOperationException>(() => sut.RenderFragment(thowingFragment))
20+
Should.Throw<InvalidOperationException>(() => sut.RenderFragment(throwingFragment))
2121
.Message.ShouldBe(ThrowsDuringSetParams.EXCEPTION.Message);
2222
}
2323

tests/bunit.core.tests/TestDoubles/PersistentComponentState/FakePersistentComponentStateTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public void Test012()
5757

5858
fakeState.TriggerOnPersisting();
5959

60-
fakeState.TryTake<WeatherForecast[]>(PersistentComponentStateSample.PersistanceKey, out var actual).ShouldBeTrue();
60+
fakeState.TryTake<WeatherForecast[]>(PersistentComponentStateSample.PersistenceKey, out var actual).ShouldBeTrue();
6161
actual.ShouldBeEquivalentTo(cut.Instance.Forecasts);
6262
}
6363

tests/bunit.testassets/SampleComponents/EventBubbles.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ public class EventBubbles : ComponentBase
77
[Parameter] public string ChildElementType { get; set; } = "div";
88
[Parameter] public bool ChildElementDisabled { get; set; }
99
[Parameter] public string? EventName { get; set; }
10-
[Parameter] public bool GrandParentStopPropergation { get; set; }
11-
[Parameter] public bool ParentStopPropergation { get; set; }
12-
[Parameter] public bool ChildStopPropergation { get; set; }
10+
[Parameter] public bool GrandParentStopPropagation { get; set; }
11+
[Parameter] public bool ParentStopPropagation { get; set; }
12+
[Parameter] public bool ChildStopPropagation { get; set; }
1313
public int GrandParentTriggerCount { get; private set; }
1414
public int ParentTriggerCount { get; private set; }
1515
public int ChildTriggerCount { get; private set; }
@@ -22,18 +22,18 @@ protected override void BuildRenderTree(RenderTreeBuilder builder)
2222
builder.OpenElement(0, "div");
2323
builder.AddAttribute(1, EventName, EventCallback.Factory.Create<EventArgs>(this, (_) => GrandParentTriggerCount++));
2424
builder.AddAttribute(2, "id", "grand-parent");
25-
builder.AddEventStopPropagationAttribute(3, EventName, GrandParentStopPropergation);
25+
builder.AddEventStopPropagationAttribute(3, EventName, GrandParentStopPropagation);
2626

2727
builder.OpenElement(10, "div");
2828
builder.AddAttribute(11, EventName, EventCallback.Factory.Create<EventArgs>(this, (_) => ParentTriggerCount++));
2929
builder.AddAttribute(12, "id", "parent");
30-
builder.AddEventStopPropagationAttribute(13, EventName, ParentStopPropergation);
30+
builder.AddEventStopPropagationAttribute(13, EventName, ParentStopPropagation);
3131

3232
builder.OpenElement(20, ChildElementType);
3333

3434
builder.AddAttribute(21, EventName, EventCallback.Factory.Create<EventArgs>(this, (_) => ChildTriggerCount++));
3535
builder.AddAttribute(22, "id", "child");
36-
builder.AddEventStopPropagationAttribute(23, EventName, ChildStopPropergation);
36+
builder.AddEventStopPropagationAttribute(23, EventName, ChildStopPropagation);
3737
if (ChildElementDisabled)
3838
{
3939
builder.AddAttribute(24, "disabled", "disabled");

tests/bunit.testassets/SampleComponents/PersistentComponentStateSample.razor.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ namespace Bunit.TestAssets.SampleComponents
22
{
33
public partial class PersistentComponentStateSample
44
{
5-
public const string PersistanceKey = "fetchdata";
5+
public const string PersistenceKey = "fetchdata";
66

77
public WeatherForecast[] Forecasts { get; private set; }
88

@@ -12,7 +12,7 @@ public partial class PersistentComponentStateSample
1212
protected override void OnInitialized()
1313
{
1414
State.RegisterOnPersisting(PersistForecasts);
15-
if (!State.TryTakeFromJson<WeatherForecast[]>(PersistanceKey, out var data))
15+
if (!State.TryTakeFromJson<WeatherForecast[]>(PersistenceKey, out var data))
1616
{
1717
Forecasts = CreateForecasts();
1818
}
@@ -24,7 +24,7 @@ protected override void OnInitialized()
2424

2525
private Task PersistForecasts()
2626
{
27-
State.PersistAsJson(PersistanceKey, Forecasts);
27+
State.PersistAsJson(PersistenceKey, Forecasts);
2828
return Task.CompletedTask;
2929
}
3030

0 commit comments

Comments
 (0)