Skip to content

Commit 6628888

Browse files
committed
Removed the constructor overloads of MockFileVersionInfo and set the default value for the optional parameters
1 parent a8380f4 commit 6628888

File tree

3 files changed

+20
-32
lines changed

3 files changed

+20
-32
lines changed

src/TestableIO.System.IO.Abstractions.TestingHelpers/MockFileVersionInfo.cs

Lines changed: 18 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,24 @@ public class MockFileVersionInfo : FileVersionInfoBase
1313
/// <inheritdoc />
1414
public MockFileVersionInfo(
1515
string fileName,
16-
string fileVersion,
17-
string productVersion,
18-
string fileDescription,
19-
string productName,
20-
string companyName,
21-
string comments,
22-
string internalName,
23-
bool isDebug,
24-
bool isPatched,
25-
bool isPrivateBuild,
26-
bool isPreRelease,
27-
bool isSpecialBuild,
28-
string language,
29-
string legalCopyright,
30-
string legalTrademarks,
31-
string originalFilename,
32-
string privateBuild,
33-
string specialBuild)
16+
string fileVersion = null,
17+
string productVersion = null,
18+
string fileDescription = null,
19+
string productName = null,
20+
string companyName = null,
21+
string comments = null,
22+
string internalName = null,
23+
bool isDebug = false,
24+
bool isPatched = false,
25+
bool isPrivateBuild = false,
26+
bool isPreRelease = false,
27+
bool isSpecialBuild = false,
28+
string language = null,
29+
string legalCopyright = null,
30+
string legalTrademarks = null,
31+
string originalFilename = null,
32+
string privateBuild = null,
33+
string specialBuild = null)
3434
{
3535
FileName = fileName;
3636
FileVersion = fileVersion;
@@ -73,18 +73,6 @@ public MockFileVersionInfo(
7373
ProductPrivatePart = productPrivate;
7474
}
7575

76-
/// <inheritdoc/>
77-
public MockFileVersionInfo(string fileName)
78-
: this(fileName, null, null, null, null, null, null, null, false, false, false, false, false, null, null, null, null, null, null) { }
79-
80-
/// <inheritdoc/>
81-
public MockFileVersionInfo(string fileName, string fileVersion, string productVersion)
82-
: this(fileName, fileVersion, productVersion, null, null, null, null, null, false, false, false, false, false, null, null, null, null, null, null) { }
83-
84-
/// <inheritdoc/>
85-
public MockFileVersionInfo()
86-
: this(null, null, null, null, null, null, null, null, false, false, false, false, false, null, null, null, null, null, null) { }
87-
8876
/// <inheritdoc/>
8977
public override string FileName { get; }
9078

tests/TestableIO.System.IO.Abstractions.TestingHelpers.Tests/MockFileVersionInfoFactoryTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class MockFileVersionInfoFactoryTests
1414
public void MockFileVersionInfoFactory_GetVersionInfo_ShouldReturnTheFileVersionInfoOfTheMockFileData()
1515
{
1616
// Arrange
17-
var fileVersionInfo = new MockFileVersionInfo();
17+
var fileVersionInfo = new MockFileVersionInfo(@"c:\a.txt");
1818
var fileSystem = new MockFileSystem(new Dictionary<string, MockFileData>
1919
{
2020
{ @"c:\a.txt", new MockFileData("Demo text content") { FileVersionInfo = fileVersionInfo } }

tests/TestableIO.System.IO.Abstractions.TestingHelpers.Tests/MockFileVersionInfoTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public void MockFileVersionInfo_Constructor_ShouldSetFileAndProductVersionNumber
7171
public void MockFileVersionInfo_Constructor_ShouldNotSetFileAndProductVersionNumbersIfFileAndProductVersionAreNull()
7272
{
7373
// Act
74-
var mockFileVersionInfo = new MockFileVersionInfo();
74+
var mockFileVersionInfo = new MockFileVersionInfo(@"c:\a.txt");
7575

7676
// Assert
7777
Assert.That(mockFileVersionInfo.FileMajorPart, Is.EqualTo(0));

0 commit comments

Comments
 (0)