Skip to content

Commit ef40806

Browse files
committed
refactoring
1 parent b22adc1 commit ef40806

7 files changed

+38
-7
lines changed

.editorconfig

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
[*.cs]
2+
3+
# CA1303: Do not pass literals as localized parameters
4+
dotnet_diagnostic.CA1303.severity = none
5+
6+
# CA1307: Specify StringComparison
7+
dotnet_diagnostic.CA1307.severity = none
8+
9+
# CA1305: Specify IFormatProvider
10+
dotnet_diagnostic.CA1305.severity = none
11+
12+
# CA1304: Specify CultureInfo
13+
dotnet_diagnostic.CA1304.severity = none
14+
15+
# CA1062: Validate arguments of public methods
16+
dotnet_diagnostic.CA1062.severity = none
17+
18+
# CA1819: Properties should not return arrays
19+
dotnet_diagnostic.CA1819.severity = none
20+
21+
# CA1055: Uri return values should not be strings
22+
dotnet_diagnostic.CA1055.severity = none
23+
24+
# CA1054: Uri parameters should not be strings
25+
dotnet_diagnostic.CA1054.severity = none
26+
27+
# CA1051: Do not declare visible instance fields
28+
dotnet_diagnostic.CA1051.severity = none
29+
30+
dotnet_diagnostic.CA1056.severity = none
31+

Fonlow.Testing.HttpCore/HttpClientWithUsername.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public string GetToken(Uri baseUri, string userName, string password)
128128
new KeyValuePair<string, string>( "username", userName ),
129129
new KeyValuePair<string, string> ( "password", password )
130130
};
131-
var content = new FormUrlEncodedContent(pairs);
131+
using var content = new FormUrlEncodedContent(pairs);
132132
try
133133
{
134134
using (var client = new HttpClient(this.handler, false))

Fonlow.Testing.HttpCore/TestingSettings.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public sealed class ServiceCommand {
7474
public string Arguments { get; set; }
7575

7676
/// <summary>
77-
/// Some services may take some seconds to launch then listen.
77+
/// Some services may take some seconds to launch then listen, especially in GitHub Actions which VM/container could be slow. A good bet may be 5 seconds.
7878
/// </summary>
7979
public int Delay { get; set; }
8080
public string ConnectionString{ get; set; }

Fonlow.Testing.ServiceCore/DotNetHostFixture.cs

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ public DotNetHostFixture()
2525

2626
public void Dispose()
2727
{
28-
Console.WriteLine("DotNetHostFixture is being disposed.");
2928
Dispose(true);
3029
GC.SuppressFinalize(this);
3130
}

Fonlow.Testing.ServiceCore/IisExpressAgentBase.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public string IisExpressArguments
5050
{
5151
get
5252
{
53+
#pragma warning disable CA1065
5354
if (SlnRoot== "SLN_ROOT_.VS")
5455
{
5556
var d = DirFunctions.GetSlnDir(System.IO.Directory.GetCurrentDirectory());
@@ -65,8 +66,10 @@ public string IisExpressArguments
6566

6667
var appHostConfig = String.IsNullOrEmpty(SlnName) ? System.IO.Path.Combine(SlnRoot, @".vs\config\applicationhost.config"): System.IO.Path.Combine(SlnRoot, $@".vs\{SlnName}\config\applicationhost.config");
6768
if (!System.IO.File.Exists(appHostConfig))
69+
{
6870
throw new ArgumentException("app.config does not contain correct info pointing to applicationhost.config for IIS Express.");
69-
71+
}
72+
#pragma warning restore CA1065
7073
var iisStartArguments = String.IsNullOrEmpty(SlnRoot) ? String.Format("/site:\"{0}\" /apppool:\"{1}\"", HostSite, HostSiteApplicationPool)
7174
: String.Format("/site:\"{0}\" /apppool:\"{1}\" /config:\"{2}\"", HostSite, HostSiteApplicationPool, appHostConfig);
7275
return iisStartArguments;

Fonlow.Testing.ServiceCore/ServiceCommandsFixture.cs

-3
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,12 @@ public ServiceCommandsFixture()
2121
}
2222
}
2323

24-
public ServiceCommand[] ServiceCommands => TestingSettings.Instance.ServiceCommands;
25-
2624
List<ServiceCommandAgent> serviceCommandAgents = new List<ServiceCommandAgent>();
2725

2826
bool disposed;
2927

3028
public void Dispose()
3129
{
32-
Console.WriteLine("ServiceCommandsFixture is being disposed.");
3330
Dispose(true);
3431
GC.SuppressFinalize(this);
3532
}

FonlowTesting.sln

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{A3630AD3
77
EndProject
88
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{68F190A5-D31E-4259-A7D8-BC96EC10EFA3}"
99
ProjectSection(SolutionItems) = preProject
10+
.editorconfig = .editorconfig
1011
BuildRelease.ps1 = BuildRelease.ps1
1112
DotNetPack.ps1 = DotNetPack.ps1
1213
README.md = README.md

0 commit comments

Comments
 (0)