From f075db04a7602f2614b7af02b802dc7ec0e1f218 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sun, 8 Dec 2024 11:22:31 +0100 Subject: [PATCH] test --- tests/Context.Tests.ps1 | 53 ----------------------------------------- 1 file changed, 53 deletions(-) diff --git a/tests/Context.Tests.ps1 b/tests/Context.Tests.ps1 index fb033e2..07f3d7a 100644 --- a/tests/Context.Tests.ps1 +++ b/tests/Context.Tests.ps1 @@ -141,56 +141,3 @@ Describe 'Functions' { } } } - -Describe 'Classes' { - Context 'Context' { - It '[Context]::new() | Should -Throw' { - [Context]::new() | Should -Throw - } - It "[Context]::new('TestID') | Should -Not -Throw" { - [Context]::new('TestID') | Should -Not -Throw - } - It "[Context]::new('TestID') | Should -BeOfType 'Context'" { - [Context]::new('TestID') | Should -BeOfType 'Context' - } - It '[Context] can be extended' { - class ExtendedContext : Context { - [string] $Name - [int] $Age - } - - $properties = @{ - ID = 'TestID' - Name = 'TestName' - Age = 42 - } - - $context = [ExtendedContext]$properties - $context | Should -BeOfType 'ExtendedContext' - $context.Name | Should -Be 'TestName' - $context.ID | Should -Not - } - It '[Context] can be extended in a class hierarchy' { - class BaseContext : Context { - [string] $Name - } - - class ExtendedContext : BaseContext { - [int] $Age - } - - $properties = @{ - ID = 'TestID' - Name = 'TestName' - Age = 42 - } - - $context = [ExtendedContext]$properties - $context | Should -BeOfType 'ExtendedContext' - $context.Name | Should -Be 'TestName' - $context.ID | Should -Be 'TestID' - Set-Context -ID 'TestID' -Context $context - [ExtendedContext](Get-Context -ID 'TestID') | Should -BeOfType 'ExtendedContext' - } - } -}