Skip to content

Commit ed53387

Browse files
committed
refactor: remove unused export strategy property and commented test code in DataExporterTests
1 parent 7767000 commit ed53387

2 files changed

Lines changed: 0 additions & 27 deletions

File tree

CodeLineCounter.Tests/DataExporterTests.cs

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -271,28 +271,6 @@ public void export_collection_throws_when_filepath_null()
271271
Assert.Equal("File path cannot be null or empty (Parameter 'filePath')", exception.Message);
272272
}
273273

274-
// ExportCollection throws IOException when there is an IO error during export
275-
// [Fact]
276-
// public void export_collection_throws_ioexception_on_io_error()
277-
// {
278-
// // Arrange
279-
// var filePath = "invalid_path/test.csv";
280-
// var testData = new List<TestClass> { new TestClass() };
281-
// var format = CoreUtils.ExportFormat.CSV;
282-
283-
// // Mock the export strategy to throw an IOException
284-
// var mockExportStrategy = new Mock<IExportStrategy>();
285-
// mockExportStrategy
286-
// .Setup(strategy => strategy.Export(It.IsAny<string>(), It.IsAny<IEnumerable<TestClass>>()))
287-
// .Throws(new IOException("IO error"));
288-
289-
// DataExporter.ExportStrategies[format] = mockExportStrategy.Object;
290-
291-
// // Act & Assert
292-
// Assert.Throws<IOException>(() =>
293-
// DataExporter.ExportCollection(filePath, testData, format));
294-
// }
295-
296274
protected virtual void Dispose(bool disposing)
297275
{
298276
if (!_disposed)

CodeLineCounter/Utils/DataExporter.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@ public static class DataExporter
1414
{ CoreUtils.ExportFormat.JSON, new JsonExportStrategy() }
1515
};
1616

17-
public static Dictionary<CoreUtils.ExportFormat, IExportStrategy> ExportStrategies
18-
{
19-
get { return _exportStrategies; }
20-
}
21-
2217
public static void Export<T>(string filePath, T data, CoreUtils.ExportFormat format) where T : class
2318
{
2419
ArgumentNullException.ThrowIfNull(data);

0 commit comments

Comments
 (0)