#author("2025-11-14T17:21:38+09:00","","")
#author("2025-11-14T17:22:02+09:00","","")
[[ソフトウェア開発>SoftwareEngineering]] / [[PowerShell>PowerShell]] / [[Pester 3.4.0>./]]

*Pester 3.4.0 [#w846e08f]
#contents

**実装サンプル [#qe1b3ffc]
***Arrays.Tests.ps1 [#j9685a4f]
#highlightjs([powershell])
 Describe "配列のテスト" {
     Context "正常系" {
         It "配列の添え字が正の値" {
             # ----------------------------------------------------------
             # Arrange
             # ----------------------------------------------------------
             $items = @("red", "green", "bule")
 
             # ----------------------------------------------------------
             # Act & Assert
             # ----------------------------------------------------------
             $items[0] | Should Be "red"
             $items[1] | Should Be "green"
             $items[2] | Should Be "bule"
         }
 
         It "配列の添え字が負の値" {
             # ----------------------------------------------------------
             # Arrange
             # ----------------------------------------------------------
             $items = @("red", "green", "bule")
 
             # ----------------------------------------------------------
             # Act & Assert
             # ----------------------------------------------------------
             $items[-3] | Should Be "red"
             $items[-2] | Should Be "green"
             $items[-1] | Should Be "bule"
         }
     }
 }

トップ   差分 履歴 リロード   一覧 検索 最終更新   ヘルプ   最終更新のRSS