Skip to content

Commit 3530ba3

Browse files
authored
[dotnet] Fix Resharper code issues (pulumi#7178)
* Fix resharper code issues for language usage opportunities * Fix resharper code issues for common practices and code improvements * Fix resharper code issues for potential code quality issues * Fix resharper code issues for redundancies in code * Fix xunit test output * Update changelog * Fix resharper code issues for compiler warnings * Fix resharper code issues for inconsistent naming * Add resharper solution settings file * Fix resharper code issues for potential code quality issues * Fix resharper code issues for redundancies in code * Fix resharper code issues for redundancies in symbol declarations
1 parent 3e170f6 commit 3530ba3

File tree

110 files changed

+622
-685
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+622
-685
lines changed

CHANGELOG_PENDING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
### Improvements
22

3+
- [dotnet] Fix Resharper code issues.
4+
[#7178](https://github.com/pulumi/pulumi/pull/7178)
35

46
- [codegen] - Include properties with an underlying type of string on Go provider instances.
57

sdk/dotnet/Pulumi.Automation.Tests/CommandExceptionTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,9 @@ public async Task ConcurrentUpdateExceptionIsThrown()
8080
var program = PulumiFn.Create(() =>
8181
{
8282
hitSemaphore = true;
83+
// ReSharper disable once AccessToDisposedClosure
8384
semaphore.Wait();
84-
return new Dictionary<string, object?>()
85+
return new Dictionary<string, object?>
8586
{
8687
["test"] = "doesnt matter",
8788
};

sdk/dotnet/Pulumi.Automation.Tests/EventLogWatcherTests.cs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// Copyright 2016-2021, Pulumi Corporation
22

3+
using System;
4+
using System.IO;
35
using System.Threading;
46
using System.Threading.Tasks;
5-
using System.IO;
6-
using System;
77
using Pulumi.Automation.Events;
88
using Xunit;
99

@@ -37,12 +37,7 @@ public async Task ReceivesManyBasicEvents()
3737
[Fact]
3838
public async Task PropagatesUserExceptionsToCaller()
3939
{
40-
using var fx = new Fixture();
41-
42-
fx.Action = ev =>
43-
{
44-
throw new MyException();
45-
};
40+
using var fx = new Fixture { Action = ev => throw new MyException() };
4641

4742
await fx.Write("{}");
4843

@@ -62,7 +57,7 @@ public async Task PermitsUserInitiatedCancellation()
6257

6358
private class MyException : Exception { }
6459

65-
private class Fixture : IDisposable
60+
private sealed class Fixture : IDisposable
6661
{
6762
public int EventCounter;
6863
public string LogFileName { get; }

sdk/dotnet/Pulumi.Automation.Tests/LocalPulumiCmdTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
using System;
44
using System.Collections.Generic;
5+
using System.Linq;
56
using System.Threading.Tasks;
6-
using Xunit;
77
using Pulumi.Automation.Commands;
8-
using System.Linq;
8+
using Xunit;
99

1010
namespace Pulumi.Automation.Tests
1111
{
@@ -15,8 +15,8 @@ public class LocalPulumiCmdTests
1515
public async Task CheckVersionCommand()
1616
{
1717
var localCmd = new LocalPulumiCmd();
18-
IDictionary<string, string?> extraEnv = new Dictionary<string, string?>();
19-
IEnumerable<string> args = new string[]{ "version" };
18+
var extraEnv = new Dictionary<string, string?>();
19+
var args = new[] { "version" };
2020

2121
var stdoutLines = new List<string>();
2222
var stderrLines = new List<string>();

0 commit comments

Comments
 (0)