mirror of
https://github.com/sshnet/SSH.NET.git
synced 2026-09-10 17:25:51 +00:00
508fc87d2a
* Fix analyzer errors in Renci.SshNet and Renci.SshNet.TestTools.OpenSSH. Suppress all errors in unit tests and integration tests. * Update unit tests now that we pass 'mode' as argument name when we throw ArgumentException. * Remove stale comment and add unit tests for SshData.ReadBytes(int length). * Remove unnessary suppression. * Remove Visual Studio magic. * Removed duplicate source file. * Clarified that suppression hides a false positive. * Remove suppressions for S2372. * Update ReadExtensionPair() to return concrete dictionary.
55 lines
1.4 KiB
C#
55 lines
1.4 KiB
C#
namespace Renci.SshNet.TestTools.OpenSSH.Formatters
|
|
{
|
|
internal sealed class MatchFormatter
|
|
{
|
|
public string Format(Match match)
|
|
{
|
|
using (var writer = new StringWriter())
|
|
{
|
|
Format(match, writer);
|
|
return writer.ToString();
|
|
}
|
|
}
|
|
|
|
public void Format(Match match, TextWriter writer)
|
|
{
|
|
writer.Write("Match ");
|
|
|
|
if (match.Users.Length > 0)
|
|
{
|
|
writer.Write("User ");
|
|
for (var i = 0; i < match.Users.Length; i++)
|
|
{
|
|
if (i > 0)
|
|
{
|
|
writer.Write(',');
|
|
}
|
|
|
|
writer.Write(match.Users[i]);
|
|
}
|
|
}
|
|
|
|
if (match.Addresses.Length > 0)
|
|
{
|
|
writer.Write("Address ");
|
|
for (var i = 0; i < match.Addresses.Length; i++)
|
|
{
|
|
if (i > 0)
|
|
{
|
|
writer.Write(',');
|
|
}
|
|
|
|
writer.Write(match.Addresses[i]);
|
|
}
|
|
}
|
|
|
|
writer.WriteLine();
|
|
|
|
if (match.AuthenticationMethods != null)
|
|
{
|
|
writer.WriteLine(" AuthenticationMethods " + match.AuthenticationMethods);
|
|
}
|
|
}
|
|
}
|
|
}
|