Skip to content

Commit f08d7a6

Browse files
committed
Cleanup code.
1 parent cde3331 commit f08d7a6

30 files changed

+166
-232
lines changed

src/Renci.SshNet.Tests/Classes/Channels/ChannelDirectTcpipTest_Dispose_SessionIsConnectedAndChannelIsOpen.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ public class ChannelDirectTcpipTest_Dispose_SessionIsConnectedAndChannelIsOpen
1616
{
1717
private Mock<ISession> _sessionMock;
1818
private Mock<IForwardedPort> _forwardedPortMock;
19-
private Mock<IConnectionInfo> _connectionInfoMock;
2019
private ChannelDirectTcpip _channel;
2120
private uint _localChannelNumber;
2221
private uint _localWindowSize;
@@ -73,7 +72,6 @@ private void Arrange()
7372

7473
_sessionMock = new Mock<ISession>(MockBehavior.Strict);
7574
_forwardedPortMock = new Mock<IForwardedPort>(MockBehavior.Strict);
76-
_connectionInfoMock = new Mock<IConnectionInfo>(MockBehavior.Strict);
7775

7876
var sequence = new MockSequence();
7977
_sessionMock.InSequence(sequence).Setup(p => p.IsConnected).Returns(true);

src/Renci.SshNet.Tests/Classes/Common/AsyncResultTest.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
using Renci.SshNet.Common;
2-
using Microsoft.VisualStudio.TestTools.UnitTesting;
3-
using System;
1+
using System;
42
using System.Threading;
3+
using Microsoft.VisualStudio.TestTools.UnitTesting;
4+
using Renci.SshNet.Common;
55
using Renci.SshNet.Tests.Common;
66

77
namespace Renci.SshNet.Tests.Classes.Common
@@ -34,7 +34,7 @@ internal virtual AsyncResult<TResult> CreateAsyncResult<TResult>()
3434
return target;
3535
}
3636

37-
[TestMethod()]
37+
[TestMethod]
3838
public void EndInvokeTest1()
3939
{
4040
EndInvokeTest1Helper<GenericParameterHelper>();
@@ -52,7 +52,7 @@ public void SetAsCompletedTest1Helper<TResult>()
5252
Assert.Inconclusive("A method that does not return a value cannot be verified.");
5353
}
5454

55-
[TestMethod()]
55+
[TestMethod]
5656
public void SetAsCompletedTest1()
5757
{
5858
SetAsCompletedTest1Helper<GenericParameterHelper>();
@@ -68,7 +68,7 @@ internal virtual AsyncResult CreateAsyncResult()
6868
/// <summary>
6969
///A test for EndInvoke
7070
///</summary>
71-
[TestMethod()]
71+
[TestMethod]
7272
public void EndInvokeTest()
7373
{
7474
AsyncResult target = CreateAsyncResult(); // TODO: Initialize to an appropriate value
@@ -79,7 +79,7 @@ public void EndInvokeTest()
7979
/// <summary>
8080
///A test for SetAsCompleted
8181
///</summary>
82-
[TestMethod()]
82+
[TestMethod]
8383
public void SetAsCompletedTest()
8484
{
8585
AsyncResult target = CreateAsyncResult(); // TODO: Initialize to an appropriate value
@@ -92,7 +92,7 @@ public void SetAsCompletedTest()
9292
/// <summary>
9393
///A test for AsyncState
9494
///</summary>
95-
[TestMethod()]
95+
[TestMethod]
9696
public void AsyncStateTest()
9797
{
9898
AsyncResult target = CreateAsyncResult(); // TODO: Initialize to an appropriate value
@@ -104,7 +104,7 @@ public void AsyncStateTest()
104104
/// <summary>
105105
///A test for AsyncWaitHandle
106106
///</summary>
107-
[TestMethod()]
107+
[TestMethod]
108108
public void AsyncWaitHandleTest()
109109
{
110110
AsyncResult target = CreateAsyncResult(); // TODO: Initialize to an appropriate value
@@ -116,7 +116,7 @@ public void AsyncWaitHandleTest()
116116
/// <summary>
117117
///A test for CompletedSynchronously
118118
///</summary>
119-
[TestMethod()]
119+
[TestMethod]
120120
public void CompletedSynchronouslyTest()
121121
{
122122
AsyncResult target = CreateAsyncResult(); // TODO: Initialize to an appropriate value
@@ -128,7 +128,7 @@ public void CompletedSynchronouslyTest()
128128
/// <summary>
129129
///A test for IsCompleted
130130
///</summary>
131-
[TestMethod()]
131+
[TestMethod]
132132
public void IsCompletedTest()
133133
{
134134
AsyncResult target = CreateAsyncResult(); // TODO: Initialize to an appropriate value

src/Renci.SshNet.Tests/Classes/Common/AuthenticationBannerEventArgsTest.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
using Renci.SshNet.Common;
2-
using Microsoft.VisualStudio.TestTools.UnitTesting;
3-
using System;
1+
using Microsoft.VisualStudio.TestTools.UnitTesting;
2+
using Renci.SshNet.Common;
43
using Renci.SshNet.Tests.Common;
54

65
namespace Renci.SshNet.Tests.Classes.Common
@@ -11,13 +10,13 @@ namespace Renci.SshNet.Tests.Classes.Common
1110
///This is a test class for AuthenticationBannerEventArgsTest and is intended
1211
///to contain all AuthenticationBannerEventArgsTest Unit Tests
1312
///</summary>
14-
[TestClass()]
13+
[TestClass]
1514
public class AuthenticationBannerEventArgsTest : TestBase
1615
{
1716
/// <summary>
1817
///A test for AuthenticationBannerEventArgs Constructor
1918
///</summary>
20-
[TestMethod()]
19+
[TestMethod]
2120
public void AuthenticationBannerEventArgsConstructorTest()
2221
{
2322
string username = string.Empty; // TODO: Initialize to an appropriate value

src/Renci.SshNet.Tests/Classes/Common/AuthenticationPasswordChangeEventArgsTest.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
using Renci.SshNet.Common;
2-
using Microsoft.VisualStudio.TestTools.UnitTesting;
3-
using System;
1+
using Microsoft.VisualStudio.TestTools.UnitTesting;
2+
using Renci.SshNet.Common;
43
using Renci.SshNet.Tests.Common;
54

65
namespace Renci.SshNet.Tests.Classes.Common
@@ -11,13 +10,13 @@ namespace Renci.SshNet.Tests.Classes.Common
1110
///This is a test class for AuthenticationPasswordChangeEventArgsTest and is intended
1211
///to contain all AuthenticationPasswordChangeEventArgsTest Unit Tests
1312
///</summary>
14-
[TestClass()]
13+
[TestClass]
1514
public class AuthenticationPasswordChangeEventArgsTest : TestBase
1615
{
1716
/// <summary>
1817
///A test for AuthenticationPasswordChangeEventArgs Constructor
1918
///</summary>
20-
[TestMethod()]
19+
[TestMethod]
2120
public void AuthenticationPasswordChangeEventArgsConstructorTest()
2221
{
2322
string username = string.Empty; // TODO: Initialize to an appropriate value
@@ -28,7 +27,7 @@ public void AuthenticationPasswordChangeEventArgsConstructorTest()
2827
/// <summary>
2928
///A test for NewPassword
3029
///</summary>
31-
[TestMethod()]
30+
[TestMethod]
3231
public void NewPasswordTest()
3332
{
3433
string username = string.Empty; // TODO: Initialize to an appropriate value

src/Renci.SshNet.Tests/Classes/Common/AuthenticationPromptEventArgsTest.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
using Renci.SshNet.Common;
1+
using System.Collections.Generic;
22
using Microsoft.VisualStudio.TestTools.UnitTesting;
3-
using System;
4-
using System.Collections.Generic;
3+
using Renci.SshNet.Common;
54
using Renci.SshNet.Tests.Common;
65

76
namespace Renci.SshNet.Tests.Classes.Common
@@ -12,13 +11,13 @@ namespace Renci.SshNet.Tests.Classes.Common
1211
///This is a test class for AuthenticationPromptEventArgsTest and is intended
1312
///to contain all AuthenticationPromptEventArgsTest Unit Tests
1413
///</summary>
15-
[TestClass()]
14+
[TestClass]
1615
public class AuthenticationPromptEventArgsTest : TestBase
1716
{
1817
/// <summary>
1918
///A test for AuthenticationPromptEventArgs Constructor
2019
///</summary>
21-
[TestMethod()]
20+
[TestMethod]
2221
public void AuthenticationPromptEventArgsConstructorTest()
2322
{
2423
string username = string.Empty; // TODO: Initialize to an appropriate value

src/Renci.SshNet.Tests/Classes/Common/AuthenticationPromptTest.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
using Renci.SshNet.Common;
2-
using Microsoft.VisualStudio.TestTools.UnitTesting;
3-
using System;
1+
using Microsoft.VisualStudio.TestTools.UnitTesting;
2+
using Renci.SshNet.Common;
43
using Renci.SshNet.Tests.Common;
54

65
namespace Renci.SshNet.Tests.Classes.Common
@@ -9,13 +8,13 @@ namespace Renci.SshNet.Tests.Classes.Common
98
///This is a test class for AuthenticationPromptTest and is intended
109
///to contain all AuthenticationPromptTest Unit Tests
1110
///</summary>
12-
[TestClass()]
11+
[TestClass]
1312
public class AuthenticationPromptTest : TestBase
1413
{
1514
/// <summary>
1615
///A test for AuthenticationPrompt Constructor
1716
///</summary>
18-
[TestMethod()]
17+
[TestMethod]
1918
public void AuthenticationPromptConstructorTest()
2019
{
2120
int id = 0; // TODO: Initialize to an appropriate value
@@ -28,7 +27,7 @@ public void AuthenticationPromptConstructorTest()
2827
/// <summary>
2928
///A test for Response
3029
///</summary>
31-
[TestMethod()]
30+
[TestMethod]
3231
public void ResponseTest()
3332
{
3433
int id = 0; // TODO: Initialize to an appropriate value

src/Renci.SshNet.Tests/Classes/Common/BigIntegerTest.cs

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
using System.Threading;
1717
using Microsoft.VisualStudio.TestTools.UnitTesting;
1818
using Renci.SshNet.Common;
19-
using System.Text.RegularExpressions;
2019
#if FEATURE_NUMERICS_BIGINTEGER
2120
using BigInteger = System.Numerics.BigInteger;
2221
#else
@@ -34,39 +33,39 @@ public class BigIntegerTest
3433
0x1D, 0x33, 0xFB, 0xFE, 0xB1, 0x2, 0x85, 0x44, 0xCA, 0xDC, 0xFB, 0x70, 0xD, 0x39,
3534
0xB1, 0x47, 0xB6, 0xE6, 0xA2, 0xD1, 0x19, 0x1E, 0x9F, 0xE4, 0x3C, 0x1E, 0x16, 0x56, 0x13, 0x9C, 0x4D, 0xD3,
3635
0x5C, 0x74, 0xC9, 0xBD, 0xFA, 0x56, 0x40, 0x58, 0xAC, 0x20, 0x6B, 0x55, 0xA2, 0xD5, 0x41, 0x38, 0xA4, 0x6D,
37-
0xF6, 0x8C,
36+
0xF6, 0x8C
3837
};
3938

4039
private static readonly byte[] huge_b =
4140
{
4241
0x96, 0x5, 0xDA, 0xFE, 0x93, 0x17, 0xC1, 0x93, 0xEC, 0x2F, 0x30, 0x2D, 0x8F,
4342
0x28, 0x13, 0x99, 0x70, 0xF4, 0x4C, 0x60, 0xA6, 0x49, 0x24, 0xF9, 0xB3, 0x4A, 0x41, 0x67, 0xDC, 0xDD, 0xB1,
4443
0xA5, 0xA6, 0xC0, 0x3D, 0x57, 0x9A, 0xCB, 0x29, 0xE2, 0x94, 0xAC, 0x6C, 0x7D, 0xEF, 0x3E, 0xC6, 0x7A, 0xC1,
45-
0xA8, 0xC8, 0xB0, 0x20, 0x95, 0xE6, 0x4C, 0xE1, 0xE0, 0x4B, 0x49, 0xD5, 0x5A, 0xB7,
44+
0xA8, 0xC8, 0xB0, 0x20, 0x95, 0xE6, 0x4C, 0xE1, 0xE0, 0x4B, 0x49, 0xD5, 0x5A, 0xB7
4645
};
4746

4847
private static readonly byte[] huge_add =
4948
{
5049
0xB3, 0x38, 0xD5, 0xFD, 0x45, 0x1A, 0x46, 0xD8, 0xB6, 0xC, 0x2C, 0x9E, 0x9C,
5150
0x61, 0xC4, 0xE0, 0x26, 0xDB, 0xEF, 0x31, 0xC0, 0x67, 0xC3, 0xDD, 0xF0, 0x68, 0x57, 0xBD, 0xEF, 0x79, 0xFF,
5251
0x78, 0x3, 0x35, 0x7, 0x15, 0x95, 0x22, 0x6A, 0x3A, 0x41, 0xCD, 0xD7, 0xD2, 0x91, 0x14, 0x8, 0xB3, 0x65,
53-
0x16, 0xBF, 0x3D, 0x20, 0x95, 0xE6, 0x4C, 0xE1, 0xE0, 0x4B, 0x49, 0xD5, 0x5A, 0xB7,
52+
0x16, 0xBF, 0x3D, 0x20, 0x95, 0xE6, 0x4C, 0xE1, 0xE0, 0x4B, 0x49, 0xD5, 0x5A, 0xB7
5453
};
5554

5655
private static readonly byte[] a_m_b =
5756
{
5857
0x87, 0x2D, 0x21, 0x0, 0x1E, 0xEB, 0xC3, 0xB0, 0xDD, 0xAC, 0xCB, 0x43, 0x7E, 0x10,
5958
0x9E, 0xAE, 0x45, 0xF2, 0x55, 0x71, 0x73, 0xD4, 0x7A, 0xEB, 0x88, 0xD3, 0xD4, 0xEE, 0x36, 0xBE, 0x9B, 0x2D,
6059
0xB6, 0xB3, 0x8B, 0x66, 0x60, 0x8B, 0x16, 0x76, 0x17, 0x74, 0xFE, 0xD7, 0xB2, 0x96, 0x7B, 0xBD, 0xE2, 0xC4,
61-
0x2D, 0xDC, 0xDE, 0x6A, 0x19, 0xB3, 0x1E, 0x1F, 0xB4, 0xB6, 0x2A, 0xA5, 0x48,
60+
0x2D, 0xDC, 0xDE, 0x6A, 0x19, 0xB3, 0x1E, 0x1F, 0xB4, 0xB6, 0x2A, 0xA5, 0x48
6261
};
6362

6463
private static readonly byte[] b_m_a =
6564
{
6665
0x79, 0xD2, 0xDE, 0xFF, 0xE1, 0x14, 0x3C, 0x4F, 0x22, 0x53, 0x34, 0xBC, 0x81,
6766
0xEF, 0x61, 0x51, 0xBA, 0xD, 0xAA, 0x8E, 0x8C, 0x2B, 0x85, 0x14, 0x77, 0x2C, 0x2B, 0x11, 0xC9, 0x41, 0x64,
6867
0xD2, 0x49, 0x4C, 0x74, 0x99, 0x9F, 0x74, 0xE9, 0x89, 0xE8, 0x8B, 0x1, 0x28, 0x4D, 0x69, 0x84, 0x42, 0x1D,
69-
0x3B, 0xD2, 0x23, 0x21, 0x95, 0xE6, 0x4C, 0xE1, 0xE0, 0x4B, 0x49, 0xD5, 0x5A, 0xB7,
68+
0x3B, 0xD2, 0x23, 0x21, 0x95, 0xE6, 0x4C, 0xE1, 0xE0, 0x4B, 0x49, 0xD5, 0x5A, 0xB7
7069
};
7170

7271
private static readonly byte[] huge_mul =
@@ -77,17 +76,17 @@ public class BigIntegerTest
7776
0xBC, 0xCA, 0x3E, 0x94, 0x95, 0xDA, 0x49, 0xE2, 0xA8, 0x33, 0xA2, 0x6A, 0x33, 0xB1, 0xF2, 0xEA, 0x99, 0x32,
7877
0xD0, 0xB2, 0xAE, 0x55, 0x75, 0xBD, 0x19, 0xFC, 0x9A, 0xEC, 0x54, 0x87, 0x2A, 0x6, 0xCC, 0x78, 0xDA, 0x88,
7978
0xBB, 0xAB, 0xA5, 0x47, 0xEF, 0xC7, 0x2B, 0xC7, 0x5B, 0x32, 0x31, 0xCD, 0xD9, 0x53, 0x96, 0x1A, 0x9D, 0x9A,
80-
0x57, 0x40, 0x51, 0xB6, 0x5D, 0xC, 0x17, 0xD1, 0x86, 0xE9, 0xA4, 0x20,
79+
0x57, 0x40, 0x51, 0xB6, 0x5D, 0xC, 0x17, 0xD1, 0x86, 0xE9, 0xA4, 0x20
8180
};
8281

83-
private static readonly byte[] huge_div = {0x0,};
82+
private static readonly byte[] huge_div = {0x0};
8483

8584
private static readonly byte[] huge_rem =
8685
{
8786
0x1D, 0x33, 0xFB, 0xFE, 0xB1, 0x2, 0x85, 0x44, 0xCA, 0xDC, 0xFB, 0x70, 0xD,
8887
0x39, 0xB1, 0x47, 0xB6, 0xE6, 0xA2, 0xD1, 0x19, 0x1E, 0x9F, 0xE4, 0x3C, 0x1E, 0x16, 0x56, 0x13, 0x9C, 0x4D,
8988
0xD3, 0x5C, 0x74, 0xC9, 0xBD, 0xFA, 0x56, 0x40, 0x58, 0xAC, 0x20, 0x6B, 0x55, 0xA2, 0xD5, 0x41, 0x38, 0xA4,
90-
0x6D, 0xF6, 0x8C,
89+
0x6D, 0xF6, 0x8C
9190
};
9291
private static readonly byte[][] add_a = {new byte[] {1}, new byte[] {0xFF}, huge_a};
9392
private static readonly byte[][] add_b = {new byte[] {1}, new byte[] {1}, huge_b};
@@ -726,7 +725,7 @@ public void ByteArrayCtorRoundTrip()
726725
arr = new byte[] { 0xFF, 00 };
727726
AssertEqual(arr, new BigInteger(arr).ToByteArray());
728727

729-
arr = new byte[] { 1, 0, 0, 0, 0, 0, };
728+
arr = new byte[] { 1, 0, 0, 0, 0, 0 };
730729
AssertEqual(new byte[] { 1 }, new BigInteger(arr).ToByteArray());
731730
}
732731

@@ -927,8 +926,8 @@ public void CompareTo()
927926
[TestMethod]
928927
public void ShortOperators()
929928
{
930-
Assert.AreEqual(22, (int)new BigInteger((short)22), "#1");
931-
Assert.AreEqual(-22, (int)new BigInteger((short)-22), "#2");
929+
Assert.AreEqual(22, (int)new BigInteger(22), "#1");
930+
Assert.AreEqual(-22, (int)new BigInteger(-22), "#2");
932931

933932
try
934933
{

0 commit comments

Comments
 (0)