Skip to content

Commit 08a9050

Browse files
Nirjan Chapagainnchapagain001
authored andcommitted
UT fix
1 parent cb9d335 commit 08a9050

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

src/VirtualClient/VirtualClient.Dependencies.UnitTests/CertificateInstallationTests.cs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,9 @@ public void ExecuteAsync_ThrowsWhenCertificateNameIsNull(PlatformID platform)
147147
}
148148

149149
[Test]
150-
[TestCase(PlatformID.Win32NT)]
151-
[TestCase(PlatformID.Unix)]
152-
public async Task ExecuteAsync_InstallsCertificateOnWindows(PlatformID platform)
150+
public async Task ExecuteAsync_InstallsCertificateOnWindows()
153151
{
154-
this.mockFixture.Setup(platform);
152+
this.mockFixture.Setup(PlatformID.Win32NT);
155153
this.mockFixture.Parameters = new Dictionary<string, IConvertible>()
156154
{
157155
{ nameof(CertificateInstallation.CertificateName), "testCert" },
@@ -287,13 +285,10 @@ public async Task InstallCertificateLocallyAsync_InstallsCertificateToDirectory(
287285
}
288286

289287
[Test]
290-
[TestCase(PlatformID.Win32NT)]
291-
[TestCase(PlatformID.Unix)]
292-
public async Task InstallCertificateLocallyAsync_SetsPermissionsOnUnix(PlatformID platform)
288+
[TestCase("/etc/certs")]
289+
public async Task InstallCertificateLocallyAsync_SetsPermissionsOnUnix(string certificateDirectory)
293290
{
294-
this.mockFixture.Setup(PlatformID.Unix);
295-
string certificateDirectory = "/etc/certs";
296-
291+
this.mockFixture.Setup(PlatformID.Unix);
297292
this.mockFixture.Parameters = new Dictionary<string, IConvertible>()
298293
{
299294
{ nameof(CertificateInstallation.CertificateName), "testCert" },

src/VirtualClient/VirtualClient.Dependencies/CertificateInstallation.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public string CertificateInstallationDir
8989
{
9090
get
9191
{
92-
return this.Parameters.GetValue<string>(nameof(this.CertificateInstallationDir));
92+
return this.Parameters.GetValue<string>(nameof(this.CertificateInstallationDir), string.Empty);
9393
}
9494
}
9595

0 commit comments

Comments
 (0)