Skip to content

Commit 493118d

Browse files
authored
Scripts and projects to make Linux-based dev easier (#109)
* Added scripts and watchtest feature * Added compiler ignore statements to editor config * Added quiet verbosity to the watchtest script * Only outputting to the console where ASPNETCORE_Environment is Production
1 parent d102c0d commit 493118d

30 files changed

+65
-26
lines changed

.editorconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,8 @@ csharp_style_var_for_built_in_types = true:error
1212
csharp_style_var_when_type_is_apparent = true:error
1313
csharp_style_var_elsewhere = true:error
1414
csharp_prefer_braces = true
15+
16+
# Remove compiler warnings
17+
dotnet_diagnostic.CS0618.severity = none ## Obsolete warning
18+
dotnet_diagnostic.CS1591.severity = none ## XML Documentation warning
19+
dotnet_diagnostic.CS1574.severity = none ## XML Documentation reference warning

scripts/watch.csproj

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<Project>
2+
<ItemGroup>
3+
<TestProjects Include="..\src\**\*.csproj" />
4+
<Watch Include="..\src\**\*.cs;..\src\**\*.razor;..\src\**\*.csproj" Exclude="..\src\**\bin\**;..\src\**\obj\**" />
5+
</ItemGroup>
6+
7+
<Target Name="test">
8+
<MSBuild Targets="VSTest" Projects="@(TestProjects)" />
9+
</Target>
10+
11+
<Import Project="$(MSBuildExtensionsPath)\Microsoft.Common.targets" />
12+
</Project>

scripts/watchtest

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/bash
2+
dotnet watch -p watch.csproj msbuild /t:test -verbosity:quiet

src/BlazorWebFormsComponents.Test/DataBinder/Eval_SimpleListView.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
{
1818

1919
var cut = GetComponentUnderTest();
20-
Console.WriteLine(cut.Markup);
20+
TestConsole.WriteLine(cut.Markup);
2121

2222
var spans = cut.FindAll("span");
2323

src/BlazorWebFormsComponents.Test/DataList/FlowLayout/FooterStyleClass.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
void FirstTest()
2121
{
2222
var cut = GetComponentUnderTest();
23-
Console.WriteLine(cut.Markup);
23+
TestConsole.WriteLine(cut.Markup);
2424
var footer = cut.Find("span").Children.FirstOrDefault(x => x.InnerHtml.Contains("FooterTemplate"));
2525
var @class = footer.GetAttribute("class");
2626

src/BlazorWebFormsComponents.Test/DataList/FlowLayout/FooterStyleEmpty.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
void FirstTest()
1919
{
2020
var cut = GetComponentUnderTest();
21-
Console.WriteLine(cut.Markup);
21+
TestConsole.WriteLine(cut.Markup);
2222
var footer = cut.Find("span").Children.FirstOrDefault(x => x.InnerHtml.Contains("FooterTemplate"));
2323

2424
footer.HasAttribute("style").ShouldBeFalse();

src/BlazorWebFormsComponents.Test/DataList/FlowLayout/FooterStyleStyle.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
void FirstTest()
2323
{
2424
var cut = GetComponentUnderTest();
25-
Console.WriteLine(cut.Markup);
25+
TestConsole.WriteLine(cut.Markup);
2626
var footer = cut.Find("span").Children.FirstOrDefault(x => x.InnerHtml.Contains("FooterTemplate"));
2727
footer.HasAttribute("style").ShouldBeTrue();
2828
var style = footer.GetAttribute("style");

src/BlazorWebFormsComponents.Test/DataList/FlowLayout/FooterTemplate.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
void FirstTest()
1717
{
1818
var cut = GetComponentUnderTest();
19-
Console.WriteLine(cut.Markup);
19+
TestConsole.WriteLine(cut.Markup);
2020
cut.FindAll("span").Count().ShouldBe(5);
2121
cut.FindAll("span").Count(c => c.TextContent == "FooterTemplate").ShouldBe(1);
2222
cut.FindAll("span").Last().TextContent.ShouldBe("FooterTemplate");

src/BlazorWebFormsComponents.Test/DataList/FlowLayout/HeaderStyleClass.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
//context.WaitForNextRender(() => { }, TimeSpan.FromSeconds(2));
4444
4545
var cut = GetComponentUnderTest();
46-
Console.WriteLine(cut.Markup);
46+
TestConsole.WriteLine(cut.Markup);
4747

4848
var theHeaderElement = cut.FindAll("span")[1];
4949

src/BlazorWebFormsComponents.Test/DataList/FlowLayout/RepeatColumns/HorizontalColumns1.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
void FirstTest()
2323
{
2424
var cut = GetComponentUnderTest();
25-
Console.WriteLine(cut.Markup);
25+
TestConsole.WriteLine(cut.Markup);
2626

2727
//DataListSpan
2828
// HeaderSpan

0 commit comments

Comments
 (0)