Skip to content

Commit c9d3c6c

Browse files
committed
More code quality fixes
1 parent e1c86c5 commit c9d3c6c

5 files changed

Lines changed: 52 additions & 52 deletions

File tree

UnitTests/Cryptography/ApplicationPkcs7MimeTests.cs

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1338,139 +1338,139 @@ protected override SecureMimeContext CreateContext ()
13381338
[Test]
13391339
public void TestEncryptRevokedRecipient ()
13401340
{
1341-
using (var ctx = new MyTemporarySecureMimeContext ()) {
1342-
ImportAll (ctx);
1341+
using (var tmp = new MyTemporarySecureMimeContext ()) {
1342+
ImportAll (tmp);
13431343

1344-
VerifyRevokedRecipient (ctx, ctx.MockHttpMessageHandler, SecureMimeTestsBase.RevokedCertificate, false);
1344+
VerifyRevokedRecipient (tmp, tmp.MockHttpMessageHandler, SecureMimeTestsBase.RevokedCertificate, false);
13451345
}
13461346

1347-
using (var ctx = new MyTemporarySecureMimeContext ()) {
1348-
ImportAll (ctx);
1347+
using (var tmp = new MyTemporarySecureMimeContext ()) {
1348+
ImportAll (tmp);
13491349

1350-
VerifyRevokedRecipient (ctx, ctx.MockHttpMessageHandler, SecureMimeTestsBase.RevokedCertificate, true);
1350+
VerifyRevokedRecipient (tmp, tmp.MockHttpMessageHandler, SecureMimeTestsBase.RevokedCertificate, true);
13511351
}
13521352

1353-
using (var ctx = new MyTemporarySecureMimeContext (CreateMockHttpMessageHandler (RevokedNoChainCertificateResponses ()))) {
1354-
ImportAll (ctx);
1353+
using (var tmp = new MyTemporarySecureMimeContext (CreateMockHttpMessageHandler (RevokedNoChainCertificateResponses ()))) {
1354+
ImportAll (tmp);
13551355

1356-
VerifyRevokedRecipient (ctx, ctx.MockHttpMessageHandler, SecureMimeTestsBase.RevokedNoChainCertificate, false);
1356+
VerifyRevokedRecipient (tmp, tmp.MockHttpMessageHandler, SecureMimeTestsBase.RevokedNoChainCertificate, false);
13571357
}
13581358

1359-
using (var ctx = new MyTemporarySecureMimeContext (CreateMockHttpMessageHandler (RevokedNoChainCertificateResponses ()))) {
1360-
ImportAll (ctx);
1359+
using (var tmp = new MyTemporarySecureMimeContext (CreateMockHttpMessageHandler (RevokedNoChainCertificateResponses ()))) {
1360+
ImportAll (tmp);
13611361

1362-
VerifyRevokedRecipient (ctx, ctx.MockHttpMessageHandler, SecureMimeTestsBase.RevokedNoChainCertificate, true);
1362+
VerifyRevokedRecipient (tmp, tmp.MockHttpMessageHandler, SecureMimeTestsBase.RevokedNoChainCertificate, true);
13631363
}
13641364
}
13651365

13661366
[Test]
13671367
public async Task TestEncryptRevokedRecipientAsync ()
13681368
{
1369-
using (var ctx = new MyTemporarySecureMimeContext ()) {
1370-
await ImportAllAsync (ctx);
1369+
using (var tmp = new MyTemporarySecureMimeContext ()) {
1370+
await ImportAllAsync (tmp);
13711371

1372-
await VerifyRevokedRecipientAsync (ctx, ctx.MockHttpMessageHandler, SecureMimeTestsBase.RevokedCertificate, false);
1372+
await VerifyRevokedRecipientAsync (tmp, tmp.MockHttpMessageHandler, SecureMimeTestsBase.RevokedCertificate, false);
13731373
}
13741374

1375-
using (var ctx = new MyTemporarySecureMimeContext ()) {
1376-
await ImportAllAsync (ctx);
1375+
using (var tmp = new MyTemporarySecureMimeContext ()) {
1376+
await ImportAllAsync (tmp);
13771377

1378-
await VerifyRevokedRecipientAsync (ctx, ctx.MockHttpMessageHandler, SecureMimeTestsBase.RevokedCertificate, true);
1378+
await VerifyRevokedRecipientAsync (tmp, tmp.MockHttpMessageHandler, SecureMimeTestsBase.RevokedCertificate, true);
13791379
}
13801380

1381-
using (var ctx = new MyTemporarySecureMimeContext (CreateMockHttpMessageHandler (RevokedNoChainCertificateResponses ()))) {
1382-
await ImportAllAsync (ctx);
1381+
using (var tmp = new MyTemporarySecureMimeContext (CreateMockHttpMessageHandler (RevokedNoChainCertificateResponses ()))) {
1382+
await ImportAllAsync (tmp);
13831383

1384-
await VerifyRevokedRecipientAsync (ctx, ctx.MockHttpMessageHandler, SecureMimeTestsBase.RevokedNoChainCertificate, false);
1384+
await VerifyRevokedRecipientAsync (tmp, tmp.MockHttpMessageHandler, SecureMimeTestsBase.RevokedNoChainCertificate, false);
13851385
}
13861386

1387-
using (var ctx = new MyTemporarySecureMimeContext (CreateMockHttpMessageHandler (RevokedNoChainCertificateResponses ()))) {
1388-
await ImportAllAsync (ctx);
1387+
using (var tmp = new MyTemporarySecureMimeContext (CreateMockHttpMessageHandler (RevokedNoChainCertificateResponses ()))) {
1388+
await ImportAllAsync (tmp);
13891389

1390-
await VerifyRevokedRecipientAsync (ctx, ctx.MockHttpMessageHandler, SecureMimeTestsBase.RevokedNoChainCertificate, true);
1390+
await VerifyRevokedRecipientAsync (tmp, tmp.MockHttpMessageHandler, SecureMimeTestsBase.RevokedNoChainCertificate, true);
13911391
}
13921392
}
13931393

13941394
[Test]
13951395
public void TestEncryptPartialRevokedRecipients ()
13961396
{
1397-
using (var ctx = new MyTemporarySecureMimeContext ()) {
1398-
ImportAll (ctx);
1397+
using (var tmp = new MyTemporarySecureMimeContext ()) {
1398+
ImportAll (tmp);
13991399

1400-
VerifyPartialRevokedRecipients (ctx, ctx.MockHttpMessageHandler, SecureMimeTestsBase.SupportedCertificates[0], SecureMimeTestsBase.RevokedCertificate);
1400+
VerifyPartialRevokedRecipients (tmp, tmp.MockHttpMessageHandler, SecureMimeTestsBase.SupportedCertificates[0], SecureMimeTestsBase.RevokedCertificate);
14011401
}
14021402
}
14031403

14041404
[Test]
14051405
public async Task TestEncryptPartialRevokedRecipientsAsync ()
14061406
{
1407-
using (var ctx = new MyTemporarySecureMimeContext ()) {
1408-
await ImportAllAsync (ctx);
1407+
using (var tmp = new MyTemporarySecureMimeContext ()) {
1408+
await ImportAllAsync (tmp);
14091409

1410-
await VerifyPartialRevokedRecipientsAsync (ctx, ctx.MockHttpMessageHandler, SecureMimeTestsBase.SupportedCertificates[0], SecureMimeTestsBase.RevokedCertificate);
1410+
await VerifyPartialRevokedRecipientsAsync (tmp, tmp.MockHttpMessageHandler, SecureMimeTestsBase.SupportedCertificates[0], SecureMimeTestsBase.RevokedCertificate);
14111411
}
14121412
}
14131413

14141414
[Test]
14151415
public void TestEncryptToValidRecipientsOnly ()
14161416
{
1417-
using (var ctx = new MyTemporarySecureMimeContext ()) {
1418-
ImportAll (ctx);
1417+
using (var tmp = new MyTemporarySecureMimeContext ()) {
1418+
ImportAll (tmp);
14191419

1420-
VerifyEncryptToValidRecipientsOnly (ctx, ctx.MockHttpMessageHandler, SecureMimeTestsBase.SupportedCertificates[0], SecureMimeTestsBase.RevokedCertificate);
1420+
VerifyEncryptToValidRecipientsOnly (tmp, tmp.MockHttpMessageHandler, SecureMimeTestsBase.SupportedCertificates[0], SecureMimeTestsBase.RevokedCertificate);
14211421
}
14221422
}
14231423

14241424
[Test]
14251425
public async Task TestEncryptToValidRecipientsOnlyAsync ()
14261426
{
1427-
using (var ctx = new MyTemporarySecureMimeContext ()) {
1428-
await ImportAllAsync (ctx);
1427+
using (var tmp = new MyTemporarySecureMimeContext ()) {
1428+
await ImportAllAsync (tmp);
14291429

1430-
await VerifyEncryptToValidRecipientsOnlyAsync (ctx, ctx.MockHttpMessageHandler, SecureMimeTestsBase.SupportedCertificates[0], SecureMimeTestsBase.RevokedCertificate);
1430+
await VerifyEncryptToValidRecipientsOnlyAsync (tmp, tmp.MockHttpMessageHandler, SecureMimeTestsBase.SupportedCertificates[0], SecureMimeTestsBase.RevokedCertificate);
14311431
}
14321432
}
14331433

14341434
[Test]
14351435
public void TestEncryptToValidRecipientsOnlyAllFail ()
14361436
{
1437-
using (var ctx = new MyTemporarySecureMimeContext ()) {
1438-
ImportAll (ctx);
1437+
using (var tmp = new MyTemporarySecureMimeContext ()) {
1438+
ImportAll (tmp);
14391439

1440-
VerifyEncryptToRevokedCertificateFails (ctx, ctx.MockHttpMessageHandler, SecureMimeTestsBase.RevokedCertificate, SecureMimeTestsBase.CrlRequestUris);
1440+
VerifyEncryptToRevokedCertificateFails (tmp, tmp.MockHttpMessageHandler, SecureMimeTestsBase.RevokedCertificate, SecureMimeTestsBase.CrlRequestUris);
14411441
}
14421442
}
14431443

14441444
[Test]
14451445
public void TestEncryptToValidRecipientsOnlySubCaRevoked ()
14461446
{
14471447
var mockHandler = CreateSubCaRevokedMockHttpMessageHandler ();
1448-
using (var ctx = new MyTemporarySecureMimeContext (mockHandler)) {
1449-
ImportAll (ctx);
1448+
using (var tmp = new MyTemporarySecureMimeContext (mockHandler)) {
1449+
ImportAll (tmp);
14501450

1451-
VerifyEncryptToValidRecipientsOnly (ctx, ctx.MockHttpMessageHandler, SecureMimeTestsBase.SupportedCertificates[0], SecureMimeTestsBase.SubCaRevokedCertificate);
1451+
VerifyEncryptToValidRecipientsOnly (tmp, tmp.MockHttpMessageHandler, SecureMimeTestsBase.SupportedCertificates[0], SecureMimeTestsBase.SubCaRevokedCertificate);
14521452
}
14531453
}
14541454

14551455
[Test]
14561456
public async Task TestEncryptToValidRecipientsOnlySubCaRevokedAsync ()
14571457
{
14581458
var mockHandler = CreateSubCaRevokedMockHttpMessageHandler ();
1459-
using (var ctx = new MyTemporarySecureMimeContext (mockHandler)) {
1460-
await ImportAllAsync (ctx);
1459+
using (var tmp = new MyTemporarySecureMimeContext (mockHandler)) {
1460+
await ImportAllAsync (tmp);
14611461

1462-
await VerifyEncryptToValidRecipientsOnlyAsync (ctx, ctx.MockHttpMessageHandler, SecureMimeTestsBase.SupportedCertificates[0], SecureMimeTestsBase.SubCaRevokedCertificate);
1462+
await VerifyEncryptToValidRecipientsOnlyAsync (tmp, tmp.MockHttpMessageHandler, SecureMimeTestsBase.SupportedCertificates[0], SecureMimeTestsBase.SubCaRevokedCertificate);
14631463
}
14641464
}
14651465

14661466
[Test]
14671467
public void TestEncryptToRevokedSubCaCertificateFails ()
14681468
{
14691469
var mockHandler = CreateSubCaRevokedMockHttpMessageHandler ();
1470-
using (var ctx = new MyTemporarySecureMimeContext (mockHandler)) {
1471-
ImportAll (ctx);
1470+
using (var tmp = new MyTemporarySecureMimeContext (mockHandler)) {
1471+
ImportAll (tmp);
14721472

1473-
VerifyEncryptToRevokedCertificateFails (ctx, ctx.MockHttpMessageHandler, SecureMimeTestsBase.SubCaRevokedCertificate, new Uri[] { SecureMimeTestsBase.CrlRequestUris[0] });
1473+
VerifyEncryptToRevokedCertificateFails (tmp, tmp.MockHttpMessageHandler, SecureMimeTestsBase.SubCaRevokedCertificate, new Uri[] { SecureMimeTestsBase.CrlRequestUris[0] });
14741474
}
14751475
}
14761476
}

UnitTests/ExperimentalMimeParserTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public class ExperimentalMimeParserTests
4141
static readonly string MboxDataDir = Path.Combine (TestHelper.ProjectDir, "TestData", "mbox");
4242
static FormatOptions UnixFormatOptions;
4343

44-
public ExperimentalMimeParserTests ()
44+
static ExperimentalMimeParserTests ()
4545
{
4646
UnixFormatOptions = FormatOptions.Default.Clone ();
4747
UnixFormatOptions.NewLineFormat = NewLineFormat.Unix;

UnitTests/InternetAddressListTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public class InternetAddressListTests
3535
{
3636
static FormatOptions UnixFormatOptions;
3737

38-
public InternetAddressListTests ()
38+
static InternetAddressListTests ()
3939
{
4040
UnixFormatOptions = FormatOptions.Default.Clone ();
4141
UnixFormatOptions.NewLineFormat = NewLineFormat.Unix;

UnitTests/MimeParserTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public class MimeParserTests
4141
static readonly string MboxDataDir = Path.Combine (TestHelper.ProjectDir, "TestData", "mbox");
4242
static FormatOptions UnixFormatOptions;
4343

44-
public MimeParserTests ()
44+
static MimeParserTests ()
4545
{
4646
UnixFormatOptions = FormatOptions.Default.Clone ();
4747
UnixFormatOptions.NewLineFormat = NewLineFormat.Unix;

UnitTests/MimeReaderTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public class MimeReaderTests
3838
static readonly string MboxDataDir = Path.Combine (TestHelper.ProjectDir, "TestData", "mbox");
3939
static FormatOptions UnixFormatOptions;
4040

41-
public MimeReaderTests ()
41+
static MimeReaderTests ()
4242
{
4343
UnixFormatOptions = FormatOptions.Default.Clone ();
4444
UnixFormatOptions.NewLineFormat = NewLineFormat.Unix;

0 commit comments

Comments
 (0)