Tests/Get-OriAzBopFolderHash.tests.ps1

. $PSScriptRoot\..\Public\Get-OriAzBopFolderHash.ps1
. $PSScriptRoot\..\Private\Invoke-OriAzExrExceptionRetry.ps1

Describe 'OriAzBopBoostrapOriPsgallery\Get-OriAzBopFolderHash' {
    
  Context 'Succesfull excution of get hash' {    

    $testPath = "TestDrive:\test.txt"
    Set-Content $testPath -value "my test text."

    $testPath = "TestDrive:\test2.txt"
    Set-Content $testPath -value "my test text2."

    $testPath = "TestDrive:\.gitignore"
    Set-Content $testPath -value "my test .gitignore."

    Mock -CommandName Write-Verbose -Verifiable

    it 'Should be succesfully processed' {
      {
        $return = Get-OriAzBopFolderHash `
          -Path "TestDrive:\"

        $return | Should -BeExactly "B1440777848A2F2FE00941329204A5F1" #"E0095AA20C8E744BF4BA0386CBA67000" #"FC5ECABB3870A9B0D6CE84704B15D2B4" #"830ABEEF0E3F12A219BBFF0FC3F32676"

      } | Should -Not -Throw
    }      
      
    Assert-MockCalled Write-Verbose -Times 1 -Exactly -ParameterFilter {
      $Message -eq "-- End of Get-OriAzBopFolderHash --"
    }
       
    Assert-VerifiableMock
  
  }

}