Skip to content

Commit 395da69

Browse files
committed
tidy
1 parent 4a4e201 commit 395da69

File tree

8 files changed

+24
-38
lines changed

8 files changed

+24
-38
lines changed

FineCodeCoverageTests/FCCEngine_Tests.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ public class FCCEngine_Tests
2121
{
2222
private AutoMoqer mocker;
2323
private FCCEngine fccEngine;
24-
private string htmlContent;
2524
private bool updatedMarginTags;
2625

2726
[SetUp]
@@ -70,13 +69,6 @@ public void Should_Set_AppDataFolderPath_From_Initialized_AppDataFolder_Director
7069
Assert.AreEqual("some path", fccEngine.AppDataFolderPath);
7170
}
7271

73-
[Test]
74-
public void Should_Update_The_Output_Window_With_Null_HtmlContent_When_ClearUI()
75-
{
76-
fccEngine.ClearUI();
77-
Assert.Null(htmlContent);
78-
}
79-
8072
[Test]
8173
public void Should_UpdateMarginTags_And_Set_Null_CoverageLines_When_ClearUI()
8274
{
@@ -452,7 +444,6 @@ private async Task ThrowReadingReportHtml()
452444
}
453445
);
454446

455-
var badPath = "^&$!";
456447

457448
List<CoverageLine> coverageLines = new List<CoverageLine>() { new CoverageLine() };
458449
mocker.GetMock<ICoberturaUtil>().Setup(coberturaUtil => coberturaUtil.CoverageLines).Returns(coverageLines);

SharedProject/Core/FCCEngine.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ internal class FCCEngine : IFCCEngine
3939
private IInitializeStatusProvider initializeStatusProvider;
4040
private readonly ICoverageToolOutputManager coverageOutputManager;
4141
internal System.Threading.Tasks.Task reloadCoverageTask;
42-
private ISolutionEvents solutionEvents; // keep alive
42+
private readonly ISolutionEvents solutionEvents; // keep alive
4343
private readonly IEventAggregator eventAggregator;
4444

4545
[ImportingConstructor]

SharedProject/Core/ReportGenerator/ReportGeneratorUtil.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ private IReportColours ReportColours
8484
}
8585
}
8686
private readonly bool showBranchCoverage = true;
87-
private List<string> logs = new List<string>();
87+
private readonly List<string> logs = new List<string>();
8888

8989
public string ReportGeneratorExePath { get; private set; }
9090

SharedProject/Core/SourceFileOpener.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ internal class SourceFileOpener : ISourceFileOpener
1515
private readonly ICoberturaUtil coberturaUtil;
1616
private readonly IMessageBox messageBox;
1717
private readonly ILogger logger;
18-
private readonly IServiceProvider serviceProvider;
1918
private readonly DTE2 dte;
2019

2120
[ImportingConstructor]
@@ -28,7 +27,6 @@ public SourceFileOpener(
2827
this.coberturaUtil = coberturaUtil;
2928
this.messageBox = messageBox;
3029
this.logger = logger;
31-
this.serviceProvider = serviceProvider;
3230
ThreadHelper.ThrowIfNotOnUIThread();
3331
dte = (DTE2)serviceProvider.GetService(typeof(DTE));
3432
Assumes.Present(dte);

SharedProject/Impl/CoverageColorProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ internal class CoverageColorProvider : ICoverageColoursProvider, ICoverageColour
1414
{
1515
private readonly IVsFontAndColorStorage fontAndColorStorage;
1616
private Guid categoryWithCoverage = Guid.Parse("ff349800-ea43-46c1-8c98-878e78f46501");
17-
private uint storeFlags = (uint)(__FCSTORAGEFLAGS.FCSF_READONLY | __FCSTORAGEFLAGS.FCSF_LOADDEFAULTS | __FCSTORAGEFLAGS.FCSF_NOAUTOCOLORS | __FCSTORAGEFLAGS.FCSF_PROPAGATECHANGES);
17+
private readonly uint storeFlags = (uint)(__FCSTORAGEFLAGS.FCSF_READONLY | __FCSTORAGEFLAGS.FCSF_LOADDEFAULTS | __FCSTORAGEFLAGS.FCSF_NOAUTOCOLORS | __FCSTORAGEFLAGS.FCSF_PROPAGATECHANGES);
1818
private System.Windows.Media.Color defaultCoverageTouchedArea = System.Windows.Media.Colors.Green;
1919
private System.Windows.Media.Color defaultCoverageNotTouchedArea = System.Windows.Media.Colors.Red;
2020
private System.Windows.Media.Color defaultCoveragePartiallyTouchedArea = System.Windows.Media.Color.FromRgb(255, 165, 0);

SharedProject/Impl/CoverageLineGlyphFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace FineCodeCoverage.Impl
99
internal class CoverageLineGlyphFactory : IGlyphFactory
1010
{
1111
private enum CoverageType { Covered, Partial, NotCovered}
12-
private ICoverageColours coverageColours;
12+
private readonly ICoverageColours coverageColours;
1313

1414
public CoverageLineGlyphFactory(ICoverageColours coverageColours)
1515
{

SharedProject/Impl/Logger.cs

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -35,27 +35,24 @@ IServiceProvider serviceProvider
3535
staticLogger = this;
3636
}
3737

38-
private void SetPane()
38+
private async Task SetPaneAsync()
3939
{
40-
ThreadHelper.JoinableTaskFactory.Run(async () =>
41-
{
42-
await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();
43-
_outputWindow = (IVsOutputWindow)_serviceProvider.GetService(typeof(SVsOutputWindow));
44-
Assumes.Present(_outputWindow);
45-
dte = (DTE2)_serviceProvider.GetService(typeof(EnvDTE.DTE));
46-
Assumes.Present(dte);
47-
48-
// Create a new pane.
49-
_outputWindow.CreatePane(
50-
ref fccPaneGuid,
51-
"FCC",
52-
Convert.ToInt32(true),
53-
Convert.ToInt32(false)); // do not clear with solution otherwise will not get initialize methods
54-
55-
// Retrieve the new pane.
56-
_outputWindow.GetPane(ref fccPaneGuid, out IVsOutputWindowPane pane);
57-
_pane = pane;
58-
});
40+
await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();
41+
_outputWindow = (IVsOutputWindow)_serviceProvider.GetService(typeof(SVsOutputWindow));
42+
Assumes.Present(_outputWindow);
43+
dte = (DTE2)_serviceProvider.GetService(typeof(EnvDTE.DTE));
44+
Assumes.Present(dte);
45+
46+
// Create a new pane.
47+
_outputWindow.CreatePane(
48+
ref fccPaneGuid,
49+
"FCC",
50+
Convert.ToInt32(true),
51+
Convert.ToInt32(false)); // do not clear with solution otherwise will not get initialize methods
52+
53+
// Retrieve the new pane.
54+
_outputWindow.GetPane(ref fccPaneGuid, out IVsOutputWindowPane pane);
55+
_pane = pane;
5956
}
6057

6158
[SuppressMessage("Usage", "VSTHRD102:Implement internal logic asynchronously")]
@@ -76,7 +73,7 @@ private void LogImpl(object[] message, bool withTitle)
7673

7774
if(_pane == null)
7875
{
79-
SetPane();
76+
await SetPaneAsync();
8077
}
8178

8279
if(_pane == null)
@@ -154,7 +151,7 @@ public async Task ShowAsync()
154151

155152
if (_pane == null)
156153
{
157-
SetPane();
154+
await SetPaneAsync();
158155
}
159156

160157
if (_pane != null)

SharedProject/Impl/TestContainerDiscovery/PackageInitializer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public async Task InitializeAsync()
3232
if (serviceProvider.GetService(typeof(SVsShell)) is IVsShell shell)
3333
{
3434
var packageToBeLoadedGuid = new Guid(OutputToolWindowPackage.PackageGuidString);
35-
shell.LoadPackage(ref packageToBeLoadedGuid, out var package);
35+
shell.LoadPackage(ref packageToBeLoadedGuid, out var _);
3636

3737
var outputWindowInitializedFile = Path.Combine(fccEngine.AppDataFolderPath, "outputWindowInitialized");
3838

0 commit comments

Comments
 (0)