Skip to content

Commit a346c5e

Browse files
committed
docs: fix indentation
1 parent 68e4485 commit a346c5e

12 files changed

Lines changed: 129 additions & 155 deletions

docs/.editorconfig

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,32 +7,6 @@ charset = utf-8
77
trim_trailing_whitespace = true
88
insert_final_newline = false
99

10-
[*.cs]
11-
indent_style = space
12-
tab_size = 2
13-
trim_trailing_whitespace = true
14-
insert_final_newline = false
15-
16-
[*.{xml,config,*proj,nuspec,props,resx,targets,yml,tasks}]
17-
tab_size = 2
18-
19-
[*.{htm,html,css,scss}]
20-
tab_size = 2
21-
22-
[*.json]
23-
tab_size = 2
24-
25-
[*.{ps1,psm1}]
26-
tab_size = 2
27-
28-
[*.sh]
29-
tab_size = 2
30-
end_of_line = lf
31-
32-
[*.{yml,yaml,md}]
33-
indent_style = space
34-
tab_size = 2
35-
3610
[*.md]
3711
trim_trailing_whitespace = false
3812

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@code {
2-
[Parameter] public string Heading { get; set; }
3-
[Parameter] public AlertType Type { get; set; }
4-
[Parameter] public RenderFragment ChildContent { get; set; }
2+
[Parameter] public string Heading { get; set; }
3+
[Parameter] public AlertType Type { get; set; }
4+
[Parameter] public RenderFragment ChildContent { get; set; }
55
}
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
namespace Docs.Components
22
{
3-
public enum AlertType
4-
{
5-
Info,
6-
Warning,
7-
Error
8-
}
3+
public enum AlertType
4+
{
5+
Info,
6+
Warning,
7+
Error
8+
}
99
}

docs/samples/components/Counter.razor

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>
88

99
@code {
10-
int currentCount = 0;
10+
int currentCount = 0;
1111

12-
void IncrementCount()
13-
{
14-
currentCount++;
15-
}
12+
void IncrementCount()
13+
{
14+
currentCount++;
15+
}
1616
}

docs/samples/components/SimpleTodo.razor

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@
1111
}
1212
</ul>
1313
@code {
14-
[CascadingParameter(Name = "Theme")]
15-
public string ThemeClass { get; set; } = string.Empty;
14+
[CascadingParameter(Name = "Theme")]
15+
public string ThemeClass { get; set; } = string.Empty;
1616

17-
private string newTaskValue = string.Empty;
17+
private string newTaskValue = string.Empty;
1818

19-
private void HandleTaskAdded()
20-
{
21-
if (!string.IsNullOrWhiteSpace(newTaskValue))
22-
Tasks.Add(newTaskValue);
19+
private void HandleTaskAdded()
20+
{
21+
if (!string.IsNullOrWhiteSpace(newTaskValue))
22+
Tasks.Add(newTaskValue);
2323

24-
newTaskValue = string.Empty;
25-
}
24+
newTaskValue = string.Empty;
25+
}
2626
}

docs/samples/tests/razor/AllFixtureParameters.razor

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
Timeout="TimeSpan.FromSeconds(2)"
77
Skip="Reason to skip the test">
88

9-
@code
10-
{
11-
void Setup(Fixture fixture) { }
12-
Task SetupAsync(Fixture fixture) => Task.CompletedTask;
13-
// NOTE: Only one of Test/TestAsync can be used at the same time.
14-
// Both are included here for illustration purposes only.
15-
void Test(Fixture fixture) { }
16-
Task TestAsync(Fixture fixture) => Task.CompletedTask;
17-
}
9+
@code
10+
{
11+
void Setup(Fixture fixture) { }
12+
Task SetupAsync(Fixture fixture) => Task.CompletedTask;
13+
// NOTE: Only one of Test/TestAsync can be used at the same time.
14+
// Both are included here for illustration purposes only.
15+
void Test(Fixture fixture) { }
16+
Task TestAsync(Fixture fixture) => Task.CompletedTask;
17+
}
1818
</Fixture>
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<Fixture Test="...">
2-
<ComponentUnderTest>
3-
<!-- Razor or HTML markup goes here -->
4-
</ComponentUnderTest>
5-
<Fragment>
6-
<!-- Razor or HTML markup goes here -->
7-
</Fragment>
8-
<Fragment Id="some id">
9-
<!-- Razor or HTML markup goes here -->
10-
</Fragment>
2+
<ComponentUnderTest>
3+
<!-- Razor or HTML markup goes here -->
4+
</ComponentUnderTest>
5+
<Fragment>
6+
<!-- Razor or HTML markup goes here -->
7+
</Fragment>
8+
<Fragment Id="some id">
9+
<!-- Razor or HTML markup goes here -->
10+
</Fragment>
1111
</Fixture>
Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
@inherits TestComponentBase
22

33
<Fixture Test="HelloWorldComponentRendersCorrectly">
4-
<ComponentUnderTest>
5-
<HelloWorld />
6-
</ComponentUnderTest>
4+
<ComponentUnderTest>
5+
<HelloWorld />
6+
</ComponentUnderTest>
77

8-
@code
8+
@code
9+
{
10+
void HelloWorldComponentRendersCorrectly(Fixture fixture)
911
{
10-
void HelloWorldComponentRendersCorrectly(Fixture fixture)
11-
{
12-
// Act
13-
var cut = fixture.GetComponentUnderTest<HelloWorld>();
12+
// Act
13+
var cut = fixture.GetComponentUnderTest<HelloWorld>();
1414

15-
// Assert
16-
cut.MarkupMatches("<h1>Hello world from Blazor</h1>");
17-
}
15+
// Assert
16+
cut.MarkupMatches("<h1>Hello world from Blazor</h1>");
1817
}
18+
}
1919
</Fixture>
2020

2121
<SnapshotTest Description="HelloWorld component renders correctly">
22-
<TestInput>
23-
<HelloWorld />
24-
</TestInput>
25-
<ExpectedOutput>
26-
<h1>Hello world from Blazor</h1>
27-
</ExpectedOutput>
22+
<TestInput>
23+
<HelloWorld />
24+
</TestInput>
25+
<ExpectedOutput>
26+
<h1>Hello world from Blazor</h1>
27+
</ExpectedOutput>
2828
</SnapshotTest>
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
@inherits TestComponentBase
22

33
<Fixture Test="fixture => { }">
4-
<ComponentUnderTest>
5-
<Alert Type="AlertType.Warning" Heading="TDD takes practise">
6-
Before you really get the benefit of TDD, you need to practice...
7-
</Alert>
8-
</ComponentUnderTest>
4+
<ComponentUnderTest>
5+
<Alert Type="AlertType.Warning" Heading="TDD takes practise">
6+
Before you really get the benefit of TDD, you need to practice...
7+
</Alert>
8+
</ComponentUnderTest>
99
</Fixture>
1010

1111
<SnapshotTest>
12-
<TestInput>
13-
<Alert Type="AlertType.Warning" Heading="TDD takes practise">
14-
Before you really get the benefit of TDD, you need to practice...
15-
</Alert>
16-
</TestInput>
17-
<ExpectedOutput>...</ExpectedOutput>
12+
<TestInput>
13+
<Alert Type="AlertType.Warning" Heading="TDD takes practise">
14+
Before you really get the benefit of TDD, you need to practice...
15+
</Alert>
16+
</TestInput>
17+
<ExpectedOutput>...</ExpectedOutput>
1818
</SnapshotTest>

docs/samples/tests/razor/SimpleTodoTest.razor

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -4,53 +4,53 @@
44
Setup="RegisterTasksService"
55
Test="WhenTaskIsAddedInputGetsReset">
66

7-
<ComponentUnderTest>
8-
<CascadingValue Name="Theme" Value=@("dark-theme")>
9-
<SimpleTodo></SimpleTodo>
10-
</CascadingValue>
11-
</ComponentUnderTest>
12-
13-
<Fragment>
14-
<form>
15-
<input placeholder="Add todo here . . ." type="text" value="" />
16-
<button type="submit">Add task</button>
17-
</form>
18-
</Fragment>
19-
20-
<Fragment Id="expected tasks">
21-
<ul class="dark-theme" id="tasks">
22-
<li>Existing task</li>
23-
<li>FOO BAR BAZ</li>
24-
</ul>
25-
</Fragment>
26-
27-
@code
7+
<ComponentUnderTest>
8+
<CascadingValue Name="Theme" Value=@("dark-theme")>
9+
<SimpleTodo></SimpleTodo>
10+
</CascadingValue>
11+
</ComponentUnderTest>
12+
13+
<Fragment>
14+
<form>
15+
<input placeholder="Add todo here . . ." type="text" value="" />
16+
<button type="submit">Add task</button>
17+
</form>
18+
</Fragment>
19+
20+
<Fragment Id="expected tasks">
21+
<ul class="dark-theme" id="tasks">
22+
<li>Existing task</li>
23+
<li>FOO BAR BAZ</li>
24+
</ul>
25+
</Fragment>
26+
27+
@code
28+
{
29+
void RegisterTasksService(Fixture fixture)
30+
=> fixture.Services.AddSingleton(new List<string>{ "Existing task" });
31+
32+
void WhenTaskIsAddedInputGetsReset(Fixture fixture)
2833
{
29-
void RegisterTasksService(Fixture fixture)
30-
=> fixture.Services.AddSingleton(new List<string>{ "Existing task" });
31-
32-
void WhenTaskIsAddedInputGetsReset(Fixture fixture)
33-
{
34-
// Arrange - get the component under test and fragments
35-
IRenderedComponent<SimpleTodo> cut = fixture.GetComponentUnderTest<SimpleTodo>();
36-
IRenderedFragment expectedFormAfterClick = fixture.GetFragment();
37-
IRenderedFragment expectedTasks = fixture.GetFragment("expected tasks");
38-
39-
// Act - change the value of the input element and click the submit button
40-
cut.Find("input").Change("FOO BAR BAZ");
41-
cut.Find("button").Click();
42-
43-
// Assert - verify cascading value was received
44-
Assert.Equal("dark-theme", cut.Instance.ThemeClass);
45-
46-
// Assert - verify that tasks had the correct theme applied
47-
// and the task added.
48-
IElement actualTasks = cut.Find("#tasks");
49-
actualTasks.MarkupMatches(expectedTasks);
50-
51-
// Assert - verify that the input form was reset after task was added
52-
IElement actualForm = cut.Find("form");
53-
actualForm.MarkupMatches(expectedFormAfterClick);
54-
}
34+
// Arrange - get the component under test and fragments
35+
IRenderedComponent<SimpleTodo> cut = fixture.GetComponentUnderTest<SimpleTodo>();
36+
IRenderedFragment expectedFormAfterClick = fixture.GetFragment();
37+
IRenderedFragment expectedTasks = fixture.GetFragment("expected tasks");
38+
39+
// Act - change the value of the input element and click the submit button
40+
cut.Find("input").Change("FOO BAR BAZ");
41+
cut.Find("button").Click();
42+
43+
// Assert - verify cascading value was received
44+
Assert.Equal("dark-theme", cut.Instance.ThemeClass);
45+
46+
// Assert - verify that tasks had the correct theme applied
47+
// and the task added.
48+
IElement actualTasks = cut.Find("#tasks");
49+
actualTasks.MarkupMatches(expectedTasks);
50+
51+
// Assert - verify that the input form was reset after task was added
52+
IElement actualForm = cut.Find("form");
53+
actualForm.MarkupMatches(expectedFormAfterClick);
5554
}
55+
}
5656
</Fixture>

0 commit comments

Comments
 (0)