Skip to content

Commit

Permalink
eliminate resource file
Browse files Browse the repository at this point in the history
  • Loading branch information
Bertk committed Jan 29, 2024
1 parent 5d40f5c commit ab442d2
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 309 deletions.
6 changes: 2 additions & 4 deletions src/coverlet.collector/DataCollection/AttachmentManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System;
using System.ComponentModel;
using System.IO;
using coverlet.collector.Resources;
using Coverlet.Collector.Utilities;
using Coverlet.Collector.Utilities.Interfaces;
using Microsoft.VisualStudio.TestPlatform.ObjectModel.DataCollection;
Expand Down Expand Up @@ -109,7 +108,7 @@ private string SaveCoverageReport(string report, string reportFileName)
}
catch (Exception ex)
{
string errorMessage = string.Format(Resources.FailedToSaveCoverageReport, CoverletConstants.DataCollectorName, reportFileName, _reportDirectory);
string errorMessage = $"{CoverletConstants.DataCollectorName}: Failed to save coverage report '{reportFileName}' in directory '{_reportDirectory}'";
throw new CoverletDataCollectorException(errorMessage, ex);
}
}
Expand Down Expand Up @@ -168,8 +167,7 @@ private void CleanupReportDirectory()
}
catch (Exception ex)
{
string errorMessage = string.Format(Resources.FailedToCleanupReportDirectory, CoverletConstants.DataCollectorName, _reportDirectory);
throw new CoverletDataCollectorException(errorMessage, ex);
throw new CoverletDataCollectorException($"{CoverletConstants.DataCollectorName}: Failed to cleanup report directory: '{_reportDirectory}'", ex);
}
}
}
Expand Down
8 changes: 3 additions & 5 deletions src/coverlet.collector/DataCollection/CoverageManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using coverlet.collector.Resources;
using Coverlet.Collector.Utilities;
using Coverlet.Collector.Utilities.Interfaces;
using Coverlet.Core;
Expand Down Expand Up @@ -68,7 +67,7 @@ public void InstrumentModules()
}
catch (Exception ex)
{
string errorMessage = string.Format(Resources.InstrumentationException, CoverletConstants.DataCollectorName);
string errorMessage = $"{CoverletConstants.DataCollectorName}: Failed to instrument modules";
throw new CoverletDataCollectorException(errorMessage, ex);
}
}
Expand Down Expand Up @@ -96,7 +95,7 @@ private CoverageResult GetCoverageResult()
}
catch (Exception ex)
{
string errorMessage = string.Format(Resources.CoverageResultException, CoverletConstants.DataCollectorName);
string errorMessage = $"{CoverletConstants.DataCollectorName}: Failed to get coverage result";
throw new CoverletDataCollectorException(errorMessage, ex);
}
}
Expand All @@ -114,8 +113,7 @@ private CoverageResult GetCoverageResult()
}
catch (Exception ex)
{
string errorMessage = string.Format(Resources.CoverageReportException, CoverletConstants.DataCollectorName);
throw new CoverletDataCollectorException(errorMessage, ex);
throw new CoverletDataCollectorException($"{CoverletConstants.DataCollectorName}: Failed to get coverage report", ex);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System.Collections.Generic;
using System.Linq;
using System.Xml;
using coverlet.collector.Resources;
using Coverlet.Collector.Utilities;

namespace Coverlet.Collector.DataCollection
Expand Down Expand Up @@ -72,8 +71,7 @@ private static string ParseTestModule(IEnumerable<string> testModules)
// Validate if at least one source present.
if (testModules == null || !testModules.Any())
{
string errorMessage = string.Format(Resources.NoTestModulesFound, CoverletConstants.DataCollectorName);
throw new CoverletDataCollectorException(errorMessage);
throw new CoverletDataCollectorException($"{CoverletConstants.DataCollectorName}: No test modules found");
}

// Note:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System.Diagnostics;
using System.Reflection;
using System.Text;
using coverlet.collector.Resources;
using Coverlet.Collector.Utilities;
using Coverlet.Core.Instrumentation;
using Microsoft.VisualStudio.TestPlatform.ObjectModel.DataCollection;
Expand Down Expand Up @@ -76,8 +75,7 @@ public void TestSessionEnd(TestSessionEndArgs testSessionEndArgs)
if (_enableExceptionLog)
{
_eqtTrace.Error("{0}: Failed to unload module with error: {1}", CoverletConstants.InProcDataCollectorName, ex);
string errorMessage = string.Format(Resources.FailedToUnloadModule, CoverletConstants.InProcDataCollectorName);
throw new CoverletDataCollectorException(errorMessage, ex);
throw new CoverletDataCollectorException($"{CoverletConstants.InProcDataCollectorName}: Failed to unload module", ex);
}
}
}
Expand Down
126 changes: 0 additions & 126 deletions src/coverlet.collector/Resources/Resources.Designer.cs

This file was deleted.

141 changes: 0 additions & 141 deletions src/coverlet.collector/Resources/Resources.resx

This file was deleted.

Loading

0 comments on commit ab442d2

Please sign in to comment.