Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
ZijianFLG committed Jun 1, 2024
1 parent b22adc1 commit ef40806
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 7 deletions.
31 changes: 31 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[*.cs]

# CA1303: Do not pass literals as localized parameters
dotnet_diagnostic.CA1303.severity = none

# CA1307: Specify StringComparison
dotnet_diagnostic.CA1307.severity = none

# CA1305: Specify IFormatProvider
dotnet_diagnostic.CA1305.severity = none

# CA1304: Specify CultureInfo
dotnet_diagnostic.CA1304.severity = none

# CA1062: Validate arguments of public methods
dotnet_diagnostic.CA1062.severity = none

# CA1819: Properties should not return arrays
dotnet_diagnostic.CA1819.severity = none

# CA1055: Uri return values should not be strings
dotnet_diagnostic.CA1055.severity = none

# CA1054: Uri parameters should not be strings
dotnet_diagnostic.CA1054.severity = none

# CA1051: Do not declare visible instance fields
dotnet_diagnostic.CA1051.severity = none

dotnet_diagnostic.CA1056.severity = none

2 changes: 1 addition & 1 deletion Fonlow.Testing.HttpCore/HttpClientWithUsername.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public string GetToken(Uri baseUri, string userName, string password)
new KeyValuePair<string, string>( "username", userName ),
new KeyValuePair<string, string> ( "password", password )
};
var content = new FormUrlEncodedContent(pairs);
using var content = new FormUrlEncodedContent(pairs);
try
{
using (var client = new HttpClient(this.handler, false))
Expand Down
2 changes: 1 addition & 1 deletion Fonlow.Testing.HttpCore/TestingSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public sealed class ServiceCommand {
public string Arguments { get; set; }

/// <summary>
/// Some services may take some seconds to launch then listen.
/// 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.
/// </summary>
public int Delay { get; set; }
public string ConnectionString{ get; set; }
Expand Down
1 change: 0 additions & 1 deletion Fonlow.Testing.ServiceCore/DotNetHostFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ public DotNetHostFixture()

public void Dispose()
{
Console.WriteLine("DotNetHostFixture is being disposed.");
Dispose(true);
GC.SuppressFinalize(this);
}
Expand Down
5 changes: 4 additions & 1 deletion Fonlow.Testing.ServiceCore/IisExpressAgentBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public string IisExpressArguments
{
get
{
#pragma warning disable CA1065
if (SlnRoot== "SLN_ROOT_.VS")
{
var d = DirFunctions.GetSlnDir(System.IO.Directory.GetCurrentDirectory());
Expand All @@ -65,8 +66,10 @@ public string IisExpressArguments

var appHostConfig = String.IsNullOrEmpty(SlnName) ? System.IO.Path.Combine(SlnRoot, @".vs\config\applicationhost.config"): System.IO.Path.Combine(SlnRoot, $@".vs\{SlnName}\config\applicationhost.config");
if (!System.IO.File.Exists(appHostConfig))
{
throw new ArgumentException("app.config does not contain correct info pointing to applicationhost.config for IIS Express.");

}
#pragma warning restore CA1065
var iisStartArguments = String.IsNullOrEmpty(SlnRoot) ? String.Format("/site:\"{0}\" /apppool:\"{1}\"", HostSite, HostSiteApplicationPool)
: String.Format("/site:\"{0}\" /apppool:\"{1}\" /config:\"{2}\"", HostSite, HostSiteApplicationPool, appHostConfig);
return iisStartArguments;
Expand Down
3 changes: 0 additions & 3 deletions Fonlow.Testing.ServiceCore/ServiceCommandsFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,12 @@ public ServiceCommandsFixture()
}
}

public ServiceCommand[] ServiceCommands => TestingSettings.Instance.ServiceCommands;

List<ServiceCommandAgent> serviceCommandAgents = new List<ServiceCommandAgent>();

bool disposed;

public void Dispose()
{
Console.WriteLine("ServiceCommandsFixture is being disposed.");
Dispose(true);
GC.SuppressFinalize(this);
}
Expand Down
1 change: 1 addition & 0 deletions FonlowTesting.sln
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{A3630AD3
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{68F190A5-D31E-4259-A7D8-BC96EC10EFA3}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
BuildRelease.ps1 = BuildRelease.ps1
DotNetPack.ps1 = DotNetPack.ps1
README.md = README.md
Expand Down

0 comments on commit ef40806

Please sign in to comment.