From a8c7da2b7df31fbc28c86f1583799f7e3439f1c0 Mon Sep 17 00:00:00 2001 From: DrIOS <58635327+DrIOSX@users.noreply.github.com> Date: Tue, 16 Apr 2024 13:33:19 -0500 Subject: [PATCH] fix: add project uri and icon to manifest. --- .vscode/settings.json | 5 ++ source/M365FoundationsCISReport.psd1 | 4 +- tests/Unit/Public/Get-Something.tests.ps1 | 91 ----------------------- 3 files changed, 7 insertions(+), 93 deletions(-) create mode 100644 .vscode/settings.json delete mode 100644 tests/Unit/Public/Get-Something.tests.ps1 diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..46b4e6a --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "cSpell.words": [ + "Msol" + ] +} \ No newline at end of file diff --git a/source/M365FoundationsCISReport.psd1 b/source/M365FoundationsCISReport.psd1 index 4c7bc06..1a9cfa2 100644 --- a/source/M365FoundationsCISReport.psd1 +++ b/source/M365FoundationsCISReport.psd1 @@ -102,10 +102,10 @@ PrivateData = @{ LicenseUri = 'https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en' # A URL to the main website for this project. - # ProjectUri = '' + ProjectUri = 'https://github.com/CriticalSolutionsNetwork/M365FoundationsCISReport' # A URL to an icon representing this module. - # IconUri = '' + IconUri = 'https://csn-source.s3.us-east-2.amazonaws.com/CSN-Icon.png' # ReleaseNotes of this module ReleaseNotes = '' diff --git a/tests/Unit/Public/Get-Something.tests.ps1 b/tests/Unit/Public/Get-Something.tests.ps1 deleted file mode 100644 index 99c0c35..0000000 --- a/tests/Unit/Public/Get-Something.tests.ps1 +++ /dev/null @@ -1,91 +0,0 @@ -BeforeAll { - $script:dscModuleName = 'M365FoundationsCISReport' - - Import-Module -Name $script:dscModuleName -} - -AfterAll { - # Unload the module being tested so that it doesn't impact any other tests. - Get-Module -Name $script:dscModuleName -All | Remove-Module -Force -} - -Describe Get-Something { - BeforeAll { - Mock -CommandName Get-PrivateFunction -MockWith { - # This return the value passed to the Get-PrivateFunction parameter $PrivateData. - $PrivateData - } -ModuleName $dscModuleName - } - - Context 'When passing values using named parameters' { - It 'Should call the private function once' { - { Get-Something -Data 'value' } | Should -Not -Throw - - Should -Invoke -CommandName Get-PrivateFunction -Exactly -Times 1 -Scope It -ModuleName $dscModuleName - } - - It 'Should return a single object' { - $return = Get-Something -Data 'value' - - ($return | Measure-Object).Count | Should -Be 1 - } - - It 'Should return the correct string value' { - $return = Get-Something -Data 'value' - - $return | Should -Be 'value' - } - } - - Context 'When passing values over the pipeline' { - It 'Should call the private function two times' { - { 'value1', 'value2' | Get-Something } | Should -Not -Throw - - Should -Invoke -CommandName Get-PrivateFunction -Exactly -Times 2 -Scope It -ModuleName $dscModuleName - } - - It 'Should return an array with two items' { - $return = 'value1', 'value2' | Get-Something - - $return.Count | Should -Be 2 - } - - It 'Should return an array with the correct string values' { - $return = 'value1', 'value2' | Get-Something - - $return[0] | Should -Be 'value1' - $return[1] | Should -Be 'value2' - } - - It 'Should accept values from the pipeline by property name' { - $return = 'value1', 'value2' | ForEach-Object { - [PSCustomObject]@{ - Data = $_ - OtherProperty = 'other' - } - } | Get-Something - - $return[0] | Should -Be 'value1' - $return[1] | Should -Be 'value2' - } - } - - Context 'When passing WhatIf' { - It 'Should support the parameter WhatIf' { - (Get-Command -Name 'Get-Something').Parameters.ContainsKey('WhatIf') | Should -Be $true - } - - It 'Should not call the private function' { - { Get-Something -Data 'value' -WhatIf } | Should -Not -Throw - - Should -Invoke -CommandName Get-PrivateFunction -Exactly -Times 0 -Scope It -ModuleName $dscModuleName - } - - It 'Should return $null' { - $return = Get-Something -Data 'value' -WhatIf - - $return | Should -BeNullOrEmpty - } - } -} -