File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66# #
77# ##########################################################################
88
9+ using module ..\containers- toolkit\Private\Logger.psm1
910
1011Describe " AllToolsUtilities.psm1" {
1112 BeforeAll {
@@ -17,6 +18,10 @@ Describe "AllToolsUtilities.psm1" {
1718 Import-Module - Name " $ModuleParentPath \Public\NerdctlTools.psm1" - Force
1819 Import-Module - Name " $ModuleParentPath \Public\ContainerNetworkTools.psm1" - Force
1920 Import-Module - Name " $ModuleParentPath \Public\AllToolsUtilities.psm1" - Force
21+
22+ # Mock functions
23+ Mock New-EventLog - ModuleName ' Logger'
24+ Mock Write-EventLog - ModuleName ' Logger'
2025 }
2126
2227 AfterAll {
@@ -268,4 +273,4 @@ Describe "AllToolsUtilities.psm1" {
268273 $Error [0 ].Exception.Message | Should - Be ' Failed to initialize NAT network. Error message'
269274 }
270275 }
271- }
276+ }
Original file line number Diff line number Diff line change 77# ##########################################################################
88
99using module " ..\containers-toolkit\Private\CommonToolUtilities.psm1"
10+ using module ..\containers- toolkit\Private\Logger.psm1
1011
1112Describe " BuildkitTools.psm1" {
1213 BeforeAll {
@@ -28,6 +29,8 @@ Describe "BuildkitTools.psm1" {
2829 # Mock functions
2930 function Test-ServiceRegistered { }
3031 Mock Test-ServiceRegistered - ModuleName ' BuildkitTools' - MockWith { return $true }
32+ Mock New-EventLog - ModuleName ' Logger'
33+ Mock Write-EventLog - ModuleName ' Logger'
3134 }
3235
3336 AfterEach {
@@ -361,4 +364,4 @@ Describe "BuildkitTools.psm1" {
361364 Should - Invoke Remove-FeatureFromPath - Times 0 - Scope It - ModuleName " BuildkitTools"
362365 }
363366 }
364- }
367+ }
Original file line number Diff line number Diff line change 88
99
1010using module " ..\containers-toolkit\Private\CommonToolUtilities.psm1"
11+ using module ..\containers- toolkit\Private\Logger.psm1
1112
1213$Script :SampleSha256Sum = @'
13146b8ff12339733a6SSaMpLeSHAe2ff9f8d333c9e898 nerdctl-2.0.0-linux-amd64.tar.gz
@@ -74,6 +75,10 @@ Describe "CommonToolUtilities.psm1" {
7475
7576 $ProgramFiles = " TestDrive:\Program Files"
7677 New-Item - Path $ProgramFiles - ItemType Directory - Force | Out-Null
78+
79+ # Mock functions
80+ Mock New-EventLog - ModuleName ' Logger'
81+ Mock Write-EventLog - ModuleName ' Logger'
7782 }
7883
7984 AfterAll {
@@ -838,4 +843,4 @@ Describe "CommonToolUtilities.psm1" {
838843 $Error [0 ].Exception.Message | Should - BeExactly " Failed to delete directory: 'TestDrive\Buildkit'. Error"
839844 }
840845 }
841- }
846+ }
Original file line number Diff line number Diff line change 88
99
1010using module " ..\containers-toolkit\Private\CommonToolUtilities.psm1"
11+ using module ..\containers- toolkit\Private\Logger.psm1
1112
1213Describe " ContainerNetworkTools.psm1" {
1314 BeforeAll {
@@ -17,6 +18,10 @@ Describe "ContainerNetworkTools.psm1" {
1718 Import-Module - Name " $ModuleParentPath \Private\CommonToolUtilities.psm1" - Force
1819 Import-Module - Name " $ModuleParentPath \Public\ContainerNetworkTools.psm1" - Force
1920 Import-Module - Name " $RootPath \Tests\TestData\MockClasses.psm1" - Force
21+
22+ # Mock functions
23+ Mock New-EventLog - ModuleName ' Logger'
24+ Mock Write-EventLog - ModuleName ' Logger'
2025 }
2126
2227 AfterEach {
@@ -295,4 +300,4 @@ Describe "ContainerNetworkTools.psm1" {
295300 $Error [0 ].Exception.Message | Should - Be ' Windows CNI plugin does not exist at TestDrive:\TestDir\cni or the directory is empty.'
296301 }
297302 }
298- }
303+ }
Original file line number Diff line number Diff line change 66# #
77# ##########################################################################
88
9+ using module ..\containers- toolkit\Private\Logger.psm1
910
1011Describe " ContainerdTools.psm1" {
1112 BeforeAll {
@@ -28,6 +29,8 @@ Describe "ContainerdTools.psm1" {
2829 # Mock functions
2930 function Test-ServiceRegistered { }
3031 Mock Test-ServiceRegistered - ModuleName ' ContainerdTools' - MockWith { return $true }
32+ Mock New-EventLog - ModuleName ' Logger'
33+ Mock Write-EventLog - ModuleName ' Logger'
3134 }
3235
3336 AfterEach {
@@ -338,4 +341,4 @@ Describe "ContainerdTools.psm1" {
338341 Should - Invoke Remove-FeatureFromPath - Times 0 - Scope It - ModuleName " ContainerdTools"
339342 }
340343 }
341- }
344+ }
Original file line number Diff line number Diff line change 88
99
1010using module " ..\containers-toolkit\Private\CommonToolUtilities.psm1"
11+ using module ..\containers- toolkit\Private\Logger.psm1
1112
1213Describe " NerdctlTools.psm1" {
1314 BeforeAll {
@@ -18,6 +19,10 @@ Describe "NerdctlTools.psm1" {
1819 Import-Module - Name " $ModuleParentPath \Public\ContainerdTools.psm1"
1920 Import-Module - Name " $ModuleParentPath \Public\ContainerNetworkTools.psm1"
2021 Import-Module - Name " $ModuleParentPath \Public\NerdctlTools.psm1" - Force
22+
23+ # Mock functions
24+ Mock New-EventLog - ModuleName ' Logger'
25+ Mock Write-EventLog - ModuleName ' Logger'
2126 }
2227
2328 AfterEach {
Original file line number Diff line number Diff line change 66# #
77# ##########################################################################
88
9+ using module ..\containers- toolkit\Private\Logger.psm1
910
1011Describe " UpdateEnvironmentPath.psm1" {
1112 BeforeAll {
@@ -16,6 +17,10 @@ Describe "UpdateEnvironmentPath.psm1" {
1617 # Original enviromnent values
1718 $Script :originalUserPathString = $ENV: Path
1819 $Script :originalSysPathString = [System.Environment ]::GetEnvironmentVariable(" Path" , " Machine" )
20+
21+ # Mock functions
22+ Mock New-EventLog - ModuleName ' Logger'
23+ Mock Write-EventLog - ModuleName ' Logger'
1924 }
2025
2126 AfterAll {
You can’t perform that action at this time.
0 commit comments