text:
Get-Module PoShKeePass | Remove-Module
# Import-Module "$PSScriptRoot\..\build\2.1.1.8\PoShKeePass\PoShKeePass.psm1" -force -ErrorAction Stop
Import-Module "$PSScriptRoot\..\PoShKeePass.psm1" -force -ErrorAction Stop

$Global:KPTestBackupDatabaseFile = "$($PSScriptRoot)\Includes\Backup\PSKeePassTestDatabase2.39.1.kdbx"
$Global:KPTestDatabaseFile = "$($PSScriptRoot)\Includes\PSKeePassTestDatabase2.39.1.kdbx"
$Global:KPTestKeyPath = "$($PSScriptRoot)\Includes\PSKeePassTestDatabase.key"

Copy-Item -Path $Global:KPTestBackupDatabaseFile -Destination $Global:KPTestDatabaseFile -Force

InModuleScope "PoShKeePass" {

    Import-KPLibrary

    $WarningPreference = 'SilentlyContinue'

    Describe "New-KPConnection - UnitTest" -Tag UnitTest {

        Context "Example 1: Open with PSKeePass Credential Object - KeyFile" {

            It "Example 1.1: Get KeePass Database Connection with KeyFile - Valid" {
                $KeePassConnection = New-KPConnection -Database "$PSScriptRoot\Includes\AuthenticationDatabases\KeyFile.kdbx" -KeyPath "$PSScriptRoot\Includes\AuthenticationDatabases\KeyFile.key"
                $KeePassConnection | Should BeOfType 'KeePassLib.PwDatabase'
                $KeePassConnection.IsOpen | Should Be $true
                $KeePassConnection.RootGroup.Name | Should Be 'KeyFile'
                $KeePassConnection.Close() | Should Be $null
                $KeePassConnection.IsOpen | Should Be $false
            }
        }

        Context "Example 2: Open with PSKeePass Credential Object - MasterKey" {

            It "Example 2.1: Get KeePass Database Connection with MasterKey - Valid" {
                $KeePassConnection = New-KPConnection -Database "$PSScriptRoot\Includes\AuthenticationDatabases\MasterKey.kdbx" -MasterKey $(ConvertTo-SecureString -String "ATestPassWord" -AsPlainText -Force)
                $KeePassConnection | Should BeOfType 'KeePassLib.PwDatabase'
                $KeePassConnection.IsOpen | Should Be $true
                $KeePassConnection.RootGroup.Name | Should Be 'MasterKey'
                $KeePassConnection.Close() | Should Be $null
                $KeePassConnection.IsOpen | Should Be $false
            }
        }

        Context "Example 3: Open with PSKeePass Credential Object - MasterKey and KeyFile" {

            It "Example 3.1: Get KeePass Database Connection with KeyAndMaster - Valid" {
                $KeePassConnection = New-KPConnection -Database "$PSScriptRoot\Includes\AuthenticationDatabases\KeyAndMaster.kdbx" -KeyPath "$PSScriptRoot\Includes\AuthenticationDatabases\KeyAndMaster.key" -MasterKey $(ConvertTo-SecureString -String "ATestPassWord" -AsPlainText -Force)
                $KeePassConnection | Should BeOfType 'KeePassLib.PwDatabase'
                $KeePassConnection.IsOpen | Should Be $true
                $KeePassConnection.RootGroup.Name | Should Be 'KeyAndMaster'
                $KeePassConnection.Close() | Should Be $null
                $KeePassConnection.IsOpen | Should Be $false
            }

            It "Example 3.2: Get KeePass Database Connection with KeyAndMaster - Invalid Key File" {
                { New-KPConnection -Database "$PSScriptRoot\Includes\AuthenticationDatabases\KeyAndMaster.kdbx" -KeyPath "$PSScriptRoot\Includes\AuthenticationDatabases\KeyFile.key" -MasterKey $(ConvertTo-SecureString -String "ATestPassWord" -AsPlainText -Force) } | Should Throw
            }
        }

        Context "Example 4: Open with PSKeePass Credential Object - KeyFile - Default Profile" {
            New-KPConfigurationFile -Force

            It "Example 4.1: Get KeePass Database Connection with KeyFile using Default Profile - Valid" {
                New-KeePassDatabaseConfiguration -DatabaseProfileName 'KeyFileTest' -DatabasePath "$PSScriptRoot\Includes\AuthenticationDatabases\KeyFile.kdbx" -KeyPath "$PSScriptRoot\Includes\AuthenticationDatabases\KeyFile.key" -Default | Should Be $null

                $KeePassConnection = New-KPConnection -DatabaseProfileName '' -MasterKey ''
                $KeePassConnection | Should BeOfType 'KeePassLib.PwDatabase'
                $KeePassConnection.IsOpen | Should Be $true
                $KeePassConnection.RootGroup.Name | Should Be 'KeyFile'
                $KeePassConnection.Close() | Should Be $null
                $KeePassConnection.IsOpen | Should Be $false
            }

            It "Example 4.2: Get KeePass Database Connection with KeyFile using Default Profile - Invalid" {
                Update-KeePassDatabaseConfiguration -DatabaseProfileName 'KeyFileTest' -Default:$false | Should Be $null

                {New-KPConnection -DatabaseProfileName '' -MasterKey ''} | Should Throw
            }
        }

        ## Holding off on Network Account Testing until I can script the creation of a database.
    }

    Describe "Remove-KPConnection - UnitTest" -Tag UnitTest {

        Context "Example 1: Close an Open PSKeePass Database Connection" {

            It "Example 1.1: Closes a KeePass Database Connection" {
                $KeePassConnection = New-KPConnection -Database "$PSScriptRoot\Includes\AuthenticationDatabases\KeyFile.kdbx" -KeyPath "$PSScriptRoot\Includes\AuthenticationDatabases\KeyFile.key"
                $KeePassConnection.IsOpen | Should Be $true
                Remove-KPConnection -KeePassConnection $KeePassConnection | Should Be $null
                $KeePassConnection.IsOpen | Should Be $false
            }
        }
    }

    Describe "New-KPConfigurationFile - UnitTest" -Tag UnitTest {

        Context "Example 1: Create a new KeePass Database Configuration XML File" {

            It "Example 1.1: Creates a New Config File - Valid" {
                if((Test-Path -Path $Global:KeePassConfigurationFile))
                {
                    Remove-Item -Path $Global:KeePassConfigurationFile -Force
                }
                New-KPConfigurationFile | Should Be $null
                Test-Path -Path $Global:KeePassConfigurationFile
            }

            It "Example 1.2: Creates a New Config File - Invalid" {
                { New-KPConfigurationFile } | Should Throw "A KeePass Configuration File already exists."
            }

            It "Example 1.3: Creates a New Config File with OverWrite - Valid" {
                New-KPConfigurationFile -Force | Should Be $null
                Test-Path -Path $Global:KeePassConfigurationFile
            }
        }
    }

    Describe "New-KeePassDatabaseConfiguration - UnitTest" -Tag UnitTest {

        Context "Example 1: Create a new KeePass Database Configuration Profile - KeyFile" {

            New-KPConfigurationFile -Force

            It "Example 1.1: Database Configuration Profile - KeyFile - Valid" {
                New-KeePassDatabaseConfiguration -DatabaseProfileName 'KeyFileTest' -DatabasePath "$PSScriptRoot\Includes\AuthenticationDatabases\KeyFile.kdbx" -KeyPath "$PSScriptRoot\Includes\AuthenticationDatabases\KeyFile.key" | Should Be $null
            }

            It "Example 1.2: Database Configuration Profile - KeyFile - Invalid Exists" {
                {New-KeePassDatabaseConfiguration -DatabaseProfileName 'KeyFileTest' -DatabasePath "$PSScriptRoot\Includes\AuthenticationDatabases\KeyFile.kdbx" -KeyPath "$PSScriptRoot\Includes\AuthenticationDatabases\KeyFile.key" } | Should Throw
            }

            It "Example 1.3: Database Configuration Profile - KeyFile - Valid with PassThru" {
                $DatabaseConfiguration = New-KeePassDatabaseConfiguration -DatabaseProfileName 'KeyFileTestPassThru' -DatabasePath "$($PSScriptRoot)\Includes\AuthenticationDatabases\KeyFile.kdbx" -KeyPath "$($PSScriptRoot)\Includes\AuthenticationDatabases\KeyFile.key" -PassThru

                $DatabaseConfiguration.Name | Should Be 'KeyFileTestPassThru'
                $DatabaseConfiguration.DatabasePath | Should Be "$($PSScriptRoot)\Includes\AuthenticationDatabases\KeyFile.kdbx"
                $DatabaseConfiguration.KeyPath | Should Be "$($PSScriptRoot)\Includes\AuthenticationDatabases\KeyFile.key"
                $DatabaseConfiguration.UseNetworkAccount | Should Be $false
                $DatabaseConfiguration.UseMasterKey | Should Be $false
                $DatabaseConfiguration.AuthenticationType | Should Be 'Key'
                $DatabaseConfiguration.Default | Should Be $false
            }
        }

        Context "Example 2: Create a new KeePass Database Configuration Profile - MasterKey" {

            New-KPConfigurationFile -Force

            It "Example 2.1: Database Configuration Profile - MasterKey - Valid" {
                New-KeePassDatabaseConfiguration -DatabaseProfileName 'MasterKeyTest' -DatabasePath "$PSScriptRoot\Includes\AuthenticationDatabases\MasterKey.kdbx" -UseMasterKey | Should Be $null
            }

            It "Example 2.2: Database Configuration Profile - MasterKey - Invalid Exists" {
                {New-KeePassDatabaseConfiguration -DatabaseProfileName 'MasterKeyTest' -DatabasePath "$PSScriptRoot\Includes\AuthenticationDatabases\MasterKey.kdbx" -UseMasterKey } | Should Throw
            }

            It "Example 2.3: Database Configuration Profile - MasterKey - Valid with PassThru" {
                $DatabaseConfiguration = New-KeePassDatabaseConfiguration -DatabaseProfileName 'MasterKeyTestPassThru' -DatabasePath "$($PSScriptRoot)\Includes\AuthenticationDatabases\MasterKey.kdbx" -UseMasterKey -PassThru

                $DatabaseConfiguration.Name | Should Be 'MasterKeyTestPassThru'
                $DatabaseConfiguration.DatabasePath | Should Be "$($PSScriptRoot)\Includes\AuthenticationDatabases\MasterKey.kdbx"
                $DatabaseConfiguration.KeyPath | Should Be ''
                $DatabaseConfiguration.UseNetworkAccount | Should Be 'False'
                $DatabaseConfiguration.UseMasterKey | Should Be 'True'
                $DatabaseConfiguration.AuthenticationType | Should Be 'Master'
            }
        }

        Context "Example 3: Create a new KeePass Database Configuration Profile - KeyFile And MasterKey" {

            New-KPConfigurationFile -Force

            It "Example 3.1: Database Configuration Profile - KeyFile And MasterKey - Valid" {
                New-KeePassDatabaseConfiguration -DatabaseProfileName 'KeyFileAndMasterKeyTest' -DatabasePath "$($PSScriptRoot)\Includes\AuthenticationDatabases\KeyAndMaster.kdbx" -KeyPath "$($PSScriptRoot)\Includes\AuthenticationDatabases\KeyAndMaster.key" -UseMasterKey | Should Be $null
            }

            It "Example 3.2: Database Configuration Profile - KeyFile And MasterKey - Invalid Exists" {
                {New-KeePassDatabaseConfiguration -DatabaseProfileName 'KeyFileAndMasterKeyTest' -DatabasePath "$($PSScriptRoot)\Includes\AuthenticationDatabases\KeyAndMaster.kdbx" -KeyPath "$($PSScriptRoot)\Includes\AuthenticationDatabases\KeyAndMaster.key" -UseMasterKey } | Should Throw
            }

            It "Example 3.3: Database Configuration Profile - KeyFile And MasterKey - Valid with PassThru" {
                $DatabaseConfiguration = New-KeePassDatabaseConfiguration -DatabaseProfileName 'KeyFileAndMasterKeyTestPassThru' -DatabasePath "$($PSScriptRoot)\Includes\AuthenticationDatabases\KeyAndMaster.kdbx" -KeyPath "$($PSScriptRoot)\Includes\AuthenticationDatabases\KeyAndMaster.key" -UseMasterKey -PassThru

                $DatabaseConfiguration.Name | Should Be 'KeyFileAndMasterKeyTestPassThru'
                $DatabaseConfiguration.DatabasePath | Should Be "$($PSScriptRoot)\Includes\AuthenticationDatabases\KeyAndMaster.kdbx"
                $DatabaseConfiguration.KeyPath | Should Be "$($PSScriptRoot)\Includes\AuthenticationDatabases\KeyAndMaster.key"
                $DatabaseConfiguration.UseNetworkAccount | Should Be 'False'
                $DatabaseConfiguration.UseMasterKey | Should Be 'True'
                $DatabaseConfiguration.AuthenticationType | Should Be 'KeyAndMaster'
            }

            It "Example 3.4: Database Configuration Profile - KeyFile And MasterKey with NetworkAccount - Invalid Authentication Combo" {
                {New-KeePassDatabaseConfiguration -DatabaseProfileName 'KeyFileAndMasterKeyAndNetworkAuthenticationTest' -DatabasePath "$($PSScriptRoot)\Includes\AuthenticationDatabases\KeyAndMaster.kdbx" -KeyPath "$($PSScriptRoot)\Includes\AuthenticationDatabases\KeyAndMaster.key" -UseMasterKey -UserNetworkAccount} | Should Throw
            }
        }

        Context "Example 4: Create a new KeePass Database Configuration Profile - Network" {

            New-KPConfigurationFile -Force

            It "Example 4.1: Database Configuration Profile - Network - Valid" {
                New-KeePassDatabaseConfiguration -DatabaseProfileName 'NetworkTest' -DatabasePath "$($PSScriptRoot)\Includes\AuthenticationDatabases\MasterKey.kdbx" -UseNetworkAccount | Should Be $null
            }

            It "Example 4.2: Database Configuration Profile - Network - Invalid Exists" {
                {New-KeePassDatabaseConfiguration -DatabaseProfileName 'NetworkTest' -DatabasePath "$($PSScriptRoot)\Includes\AuthenticationDatabases\MasterKey.kdbx" -UseNetworkAccount } | Should Throw
            }

            It "Example 4.3: Database Configuration Profile - Network - Valid with PassThru" {
                $DatabaseConfiguration = New-KeePassDatabaseConfiguration -DatabaseProfileName 'NetworkTestPassThru' -DatabasePath "$($PSScriptRoot)\Includes\AuthenticationDatabases\MasterKey.kdbx" -UseNetworkAccount -PassThru

                $DatabaseConfiguration.Name | Should Be 'NetworkTestPassThru'
                $DatabaseConfiguration.DatabasePath | Should Be "$($PSScriptRoot)\Includes\AuthenticationDatabases\MasterKey.kdbx"
                $DatabaseConfiguration.KeyPath | Should Be ''
                $DatabaseConfiguration.UseNetworkAccount | Should Be 'True'
                $DatabaseConfiguration.UseMasterKey | Should Be 'False'
                $DatabaseConfiguration.AuthenticationType | Should Be 'Network'
            }
        }

        Context "Example 5: Create a new KeePass Database Configuration Profile - Default DB" {

            New-KPConfigurationFile -Force

            It "Example 5.1: Database Configuration Profile - Default - Valid with PassThru" {
                $DatabaseConfiguration = New-KeePassDatabaseConfiguration -DatabaseProfileName 'DefaultTestPassThru' -DatabasePath "$($PSScriptRoot)\Includes\AuthenticationDatabases\MasterKey.kdbx" -UseNetworkAccount -Default -PassThru

                $DatabaseConfiguration.Name | Should Be 'DefaultTestPassThru'
                $DatabaseConfiguration.DatabasePath | Should Be "$($PSScriptRoot)\Includes\AuthenticationDatabases\MasterKey.kdbx"
                $DatabaseConfiguration.KeyPath | Should Be ''
                $DatabaseConfiguration.UseNetworkAccount | Should Be $True
                $DatabaseConfiguration.UseMasterKey | Should Be $false
                $DatabaseConfiguration.AuthenticationType | Should Be 'Network'
                $DatabaseConfiguration.Default | Should Be $true
            }

            It "Example 5.2: Database Configuration Profile - Default - Invalid Already Default" {
                {New-KeePassDatabaseConfiguration -DatabaseProfileName 'DefaultTestFailPassThru' -DatabasePath "$($PSScriptRoot)\Includes\AuthenticationDatabases\MasterKey.kdbx" -UseNetworkAccount -Default -PassThru } | should Throw
                # $Error[0].exception.message -ilike 'DefaultTestPassThru profile is already set to the default*' | should be $true
            }
        }
    }

    Describe "Get-KeePassDatabaseConfiguration - UnitTest" -Tag UnitTest {
        New-KPConfigurationFile -Force

        Context "Example 1: Get a KeePass Database Configuration Profile" {

            It "Example 1.1: Get Database Configuration Profile - Valid - By Name" {
                New-KeePassDatabaseConfiguration -DatabaseProfileName 'SampleProfile' -DatabasePath "$($PSScriptRoot)\Includes\AuthenticationDatabases\MasterKey.kdbx" -UseNetworkAccount | Should Be $null

                $DatabaseConfiguration = Get-KeePassDatabaseConfiguration -DatabaseProfileName 'SampleProfile'

                $DatabaseConfiguration.Name | Should Be 'SampleProfile'
                $DatabaseConfiguration.DatabasePath | Should Be "$($PSScriptRoot)\Includes\AuthenticationDatabases\MasterKey.kdbx"
                $DatabaseConfiguration.KeyPath | Should Be ''
                $DatabaseConfiguration.UseNetworkAccount | Should Be 'True'
                $DatabaseConfiguration.UseMasterKey | Should Be 'False'
                $DatabaseConfiguration.AuthenticationType | Should Be 'Network'
            }

            It "Example 1.2: Get Database Configuration Profile - Valid - All" {
                $DatabaseConfiguration = Get-KeePassDatabaseConfiguration -DatabaseProfileName 'SampleProfile'

                $DatabaseConfiguration.Name | Should Be 'SampleProfile'
                $DatabaseConfiguration.DatabasePath | Should Be "$($PSScriptRoot)\Includes\AuthenticationDatabases\MasterKey.kdbx"
                $DatabaseConfiguration.KeyPath | Should Be ''
                $DatabaseConfiguration.UseNetworkAccount | Should Be 'True'
                $DatabaseConfiguration.UseMasterKey | Should Be 'False'
                $DatabaseConfiguration.AuthenticationType | Should Be 'Network'
            }

            It "Example 1.3: Get Database Configuration Profile - Valid - By Default" {
                New-KeePassDatabaseConfiguration -DatabaseProfileName 'SampleProfile1' -DatabasePath "$($PSScriptRoot)\Includes\AuthenticationDatabases\MasterKey.kdbx" -UseNetworkAccount -Default | Should Be $null

                $DatabaseConfiguration = Get-KeePassDatabaseConfiguration -Default

                $DatabaseConfiguration.Name | Should Be 'SampleProfile1'
                $DatabaseConfiguration.DatabasePath | Should Be "$($PSScriptRoot)\Includes\AuthenticationDatabases\MasterKey.kdbx"
                $DatabaseConfiguration.KeyPath | Should Be ''
                $DatabaseConfiguration.UseNetworkAccount | Should Be 'True'
                $DatabaseConfiguration.UseMasterKey | Should Be 'False'
                $DatabaseConfiguration.AuthenticationType | Should Be 'Network'
                $DatabaseConfiguration.Default | Should Be $true
            }
        }

        New-KPConfigurationFile -Force
    }

    Describe "Update-KeePassDatabaseConfiguration - UnitTest" -Tag UnitTest {
        New-KPConfigurationFile -Force

        Context "Example 1: Update a KeePass Database Configuration Profile" {

            It "Example 1.1: Update Database Configuration Profile - Valid - By Name" {
                New-KeePassDatabaseConfiguration -DatabaseProfileName 'SampleProfile' -DatabasePath "$($PSScriptRoot)\Includes\AuthenticationDatabases\MasterKey.kdbx" -UseNetworkAccount | Should Be $null

                $DatabaseConfiguration = Update-KeePassDatabaseConfiguration -DatabaseProfileName 'SampleProfile' -NewDatabaseProfileName 'Updated' -PassThru

                $DatabaseConfiguration.Name | Should Be 'Updated'
                $DatabaseConfiguration.DatabasePath | Should Be "$($PSScriptRoot)\Includes\AuthenticationDatabases\MasterKey.kdbx"
                $DatabaseConfiguration.KeyPath | Should Be ''
                $DatabaseConfiguration.UseNetworkAccount | Should Be 'True'
                $DatabaseConfiguration.UseMasterKey | Should Be 'False'
                $DatabaseConfiguration.AuthenticationType | Should Be 'Network'
            }
        }

        Context "Example 2: Update a KeePass Database Configuration Profile - Default DB" {

            New-KPConfigurationFile -Force

            It "Example 2.1: Update Database Configuration Profile - Valid - DefaultDB" {
                New-KeePassDatabaseConfiguration -DatabaseProfileName 'SampleProfile' -DatabasePath "$($PSScriptRoot)\Includes\AuthenticationDatabases\MasterKey.kdbx" -UseNetworkAccount | Should Be $null

                $DatabaseConfiguration = Update-KeePassDatabaseConfiguration -DatabaseProfileName 'SampleProfile' -NewDatabaseProfileName 'Updated' -Default -PassThru

                $DatabaseConfiguration.Name | Should Be 'Updated'
                $DatabaseConfiguration.DatabasePath | Should Be "$($PSScriptRoot)\Includes\AuthenticationDatabases\MasterKey.kdbx"
                $DatabaseConfiguration.KeyPath | Should Be ''
                $DatabaseConfiguration.UseNetworkAccount | Should Be 'True'
                $DatabaseConfiguration.UseMasterKey | Should Be 'False'
                $DatabaseConfiguration.AuthenticationType | Should Be 'Network'
                $DatabaseConfiguration.Default | Should Be $true
            }

            It "Example 2.2: Update Database Configuration Profile - Valid - Invalid Already Default" {
                {New-KeePassDatabaseConfiguration -DatabaseProfileName 'SampleProfile1' -DatabasePath "$($PSScriptRoot)\Includes\AuthenticationDatabases\MasterKey.kdbx" -UseNetworkAccount -Default -PassThru } | should Throw
                # $Error[0].exception.message -ilike 'DefaultTestPassThru profile is already set to the default*' | should be $true
            }
        }

        New-KPConfigurationFile -Force
    }

    Describe "Remove-KeePassDatabaseConfiguration - UnitTest" -Tag UnitTest {
        New-KPConfigurationFile -Force

        Context "Example 1: Remove a KeePass Database Configuration Profile" {

            It "Example 1.1: Remove Database Configuration Profile - Valid - By Name" {
                New-KeePassDatabaseConfiguration -DatabaseProfileName 'SampleProfile' -DatabasePath "$($PSScriptRoot)\Includes\AuthenticationDatabases\MasterKey.kdbx" -UseNetworkAccount | Should Be $null

                # Get-KeePassDatabaseConfiguration -DatabaseProfileName 'SampleProfile'

                Remove-KeePassDatabaseConfiguration -DatabaseProfileName 'SampleProfile' -confirm:$false | Should Be $null

                Get-KeePassDatabaseConfiguration -DatabaseProfileName 'SampleProfile' | Should Be $null
            }

            It "Example 1.2: Remove Database Configuration Profile - Valid - By Name - Via Pipeline" {
                New-KeePassDatabaseConfiguration -DatabaseProfileName 'SampleProfile' -DatabasePath "$($PSScriptRoot)\Includes\AuthenticationDatabases\MasterKey.kdbx" -UseNetworkAccount | Should Be $null

                Get-KeePassDatabaseConfiguration -DatabaseProfileName 'SampleProfile' | Remove-KeePassDatabaseConfiguration -confirm:$false | Should Be $null

                Get-KeePassDatabaseConfiguration -DatabaseProfileName 'SampleProfile' | Should Be $null
            }

            It "Example 1.3: Remove Database Configuration Profile - Valid - Multiple - Via Pipeline" {
                New-KeePassDatabaseConfiguration -DatabaseProfileName 'SampleProfile' -DatabasePath "$($PSScriptRoot)\Includes\AuthenticationDatabases\MasterKey.kdbx" -UseNetworkAccount | Should Be $null

                New-KeePassDatabaseConfiguration -DatabaseProfileName 'SampleProfile1' -DatabasePath "$($PSScriptRoot)\Includes\AuthenticationDatabases\MasterKey.kdbx" -UseNetworkAccount | Should Be $null

                Get-KeePassDatabaseConfiguration | Remove-KeePassDatabaseConfiguration -confirm:$false | Should Be $null

                Get-KeePassDatabaseConfiguration | Should Be $null
            }
        }

        New-KPConfigurationFile -Force
    }

    Describe "New-KPConnection - Profile - UnitTest" -Tag UnitTest {

        Context "Example 1: Open with PSKeePass Credential Object - KeyFile - Profile" {
            New-KPConfigurationFile -Force

            It "Example 1.1: Get KeePass Database Connection with KeyFile from a Profile- Valid" {
                New-KeePassDatabaseConfiguration -DatabaseProfileName 'KeyFileTest' -DatabasePath "$PSScriptRoot\Includes\AuthenticationDatabases\KeyFile.kdbx" -KeyPath "$PSScriptRoot\Includes\AuthenticationDatabases\KeyFile.key" | Should Be $null
                $KeePassConnection = New-KPConnection -DatabaseProfileName 'KeyFileTest'
                $KeePassConnection | Should BeOfType 'KeePassLib.PwDatabase'
                $KeePassConnection.IsOpen | Should Be $true
                $KeePassConnection.RootGroup.Name | Should Be 'KeyFile'
                $KeePassConnection.Close() | Should Be $null
                $KeePassConnection.IsOpen | Should Be $false
            }
        }

        Context "Example 2: Open with PSKeePass Credential Object - MasterKey - Profile" {
            New-KPConfigurationFile -Force

            It "Example 2.1: Get KeePass Database Connection with MasterKey from a Profile - Valid" {
                New-KeePassDatabaseConfiguration -DatabaseProfileName 'MasterKeyTest' -DatabasePath "$PSScriptRoot\Includes\AuthenticationDatabases\MasterKey.kdbx" -UseMasterKey | Should Be $null
                $KeePassConnection = New-KPConnection -DatabaseProfileName 'MasterKeyTest' -MasterKey $(ConvertTo-SecureString -String "ATestPassWord" -AsPlainText -Force)
                $KeePassConnection | Should BeOfType 'KeePassLib.PwDatabase'
                $KeePassConnection.IsOpen | Should Be $true
                $KeePassConnection.RootGroup.Name | Should Be 'MasterKey'
                $KeePassConnection.Close() | Should Be $null
                $KeePassConnection.IsOpen | Should Be $false
            }
        }

        Context "Example 3: Open with PSKeePass Credential Object - MasterKey and KeyFile - Profile" {
            New-KPConfigurationFile -Force

            It "Example 3.1: Get KeePass Database Connection with KeyAndMaster from a Profile - Valid" {
                New-KeePassDatabaseConfiguration -DatabaseProfileName 'KeyFileAndMasterKeyTest' -DatabasePath "$($PSScriptRoot)\Includes\AuthenticationDatabases\KeyAndMaster.kdbx" -KeyPath "$($PSScriptRoot)\Includes\AuthenticationDatabases\KeyAndMaster.key" -UseMasterKey | Should Be $null
                $KeePassConnection = New-KPConnection -DatabaseProfileName 'KeyFileAndMasterKeyTest' -MasterKey $(ConvertTo-SecureString -String "ATestPassWord" -AsPlainText -Force)
                $KeePassConnection | Should BeOfType 'KeePassLib.PwDatabase'
                $KeePassConnection.IsOpen | Should Be $true
                $KeePassConnection.RootGroup.Name | Should Be 'KeyAndMaster'
                $KeePassConnection.Close() | Should Be $null
                $KeePassConnection.IsOpen | Should Be $false
            }
        }

        ## Holding off on Network Account Testing until I can script the creation of a database.
    }

    Describe "New-KeePassPassword - UnitTest" -Tag UnitTest {

        Context "Example 1: Generate a new KeePass Password - Options" {

            It "Example 1.1: New Password using all basic options - Valid" {
                New-KeePassPassword -UpperCase -LowerCase -Digits -SpecialCharacters -Minus -UnderScore -Space -Brackets -Length 20 | Should BeOfType KeePassLib.Security.ProtectedString
            }

            It "Example 1.2: New Password using all basic options + ExcludeLookALike - Valid" {
                New-KeePassPassword -UpperCase -LowerCase -Digits -SpecialCharacters -Minus -UnderScore -Space -Brackets -Length 20 -ExcludeLookALike | Should BeOfType KeePassLib.Security.ProtectedString
            }

            It "Example 1.3: New Password using all basic options + NoRepeatingCharacters - Valid" {
                New-KeePassPassword -UpperCase -LowerCase -Digits -SpecialCharacters -Minus -UnderScore -Space -Brackets -Length 20 -NoRepeatingCharacters | Should BeOfType KeePassLib.Security.ProtectedString
            }

            It "Example 1.4: New Password using some basic options + NoRepeatingCharacters - Invalid" {
                { New-KeePassPassword -UpperCase -LowerCase -Digits -SpecialCharacters -Length 85 -NoRepeatingCharacters } | Should Throw 'Unabled to generate a password with the specified options.'
            }

            It "Example 1.5: New Password using all basic options + ExcludedCharactes - Valid" {
                $SecurePass = New-KeePassPassword -UpperCase -LowerCase -Digits -SpecialCharacters -Minus -UnderScore -Space -Brackets -Length 70 -ExcludeCharacters '1,],-a'

                $SecurePass |  Should BeOfType KeePassLib.Security.ProtectedString

                $SecurePass.ReadString() | Should Not Match ([regex]::Escape("^.*[1\]-a].*$"))
            }
        }

        Context "Example 2: Generate a new KeePass Password - Options - SaveAs" {

            New-KPConfigurationFile -Force

            It "Example 2.1: New Password using all basic options - Valid" {
                New-KeePassPassword -UpperCase -LowerCase -Digits -SpecialCharacters -Minus -UnderScore -Space -Brackets -Length 20 -SaveAs 'Basic20' | Should BeOfType KeePassLib.Security.ProtectedString

                $PassProfile = Get-KPPasswordProfile -PasswordProfileName 'Basic20'
                $PassProfile.Name | Should Be 'Basic20'
                $PassProfile.CharacterSet | Should Be 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!"#$%&''*+,./:;=?@\^`|~-_ []{}()<>'
                $PassProfile.ExcludeLookAlike | Should Be 'False'
                $PassProfile.NoRepeatingCharacters | Should Be 'False'
                $PassProfile.ExcludeCharacters | Should Be ''
                $PassProfile.Length | Should Be 20
            }

            It "Example 2.2: New Password using all basic options + ExcludeLookALike - Valid" {
                New-KeePassPassword -UpperCase -LowerCase -Digits -SpecialCharacters -Minus -UnderScore -Space -Brackets -Length 20 -ExcludeLookALike -SaveAs 'BasicNoLookAlike20' | Should BeOfType KeePassLib.Security.ProtectedString

                $PassProfile = Get-KPPasswordProfile -PasswordProfileName 'BasicNoLookAlike20'
                $PassProfile.Name | Should Be 'BasicNoLookAlike20'
                $PassProfile.CharacterSet | Should Be 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!"#$%&''*+,./:;=?@\^`|~-_ []{}()<>'
                $PassProfile.ExcludeLookAlike | Should Be 'True'
                $PassProfile.NoRepeatingCharacters | Should Be 'False'
                $PassProfile.ExcludeCharacters | Should Be ''
                $PassProfile.Length | Should Be 20
            }

            It "Example 2.3: New Password using all basic options + NoRepeatingCharacters - Valid" {
                New-KeePassPassword -UpperCase -LowerCase -Digits -SpecialCharacters -Minus -UnderScore -Space -Brackets -Length 20 -NoRepeatingCharacters -SaveAs 'BasicNoRepeat20' | Should BeOfType KeePassLib.Security.ProtectedString

                $PassProfile = Get-KPPasswordProfile -PasswordProfileName 'BasicNoRepeat20'
                $PassProfile.Name | Should Be 'BasicNoRepeat20'
                $PassProfile.CharacterSet | Should Be 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!"#$%&''*+,./:;=?@\^`|~-_ []{}()<>'
                $PassProfile.ExcludeLookAlike | Should Be 'False'
                $PassProfile.NoRepeatingCharacters | Should Be 'True'
                $PassProfile.ExcludeCharacters | Should Be ''
                $PassProfile.Length | Should Be 20
            }

            It "Example 2.4: New Password using some basic options + NoRepeatingCharacters - Invalid" {
                { New-KeePassPassword -UpperCase -LowerCase -Digits -SpecialCharacters -Length 85 -NoRepeatingCharacters -SaveAs 'BasicNoRepeatInvalid' } | Should Throw 'Unabled to generate a password with the specified options.'

                Get-KPPasswordProfile -PasswordProfileName 'BasicNoRepeatInvalid' | Should Be $null
            }

            It "Example 2.5: New Password using all basic options + ExcludedCharactes - Valid" {
                $SecurePass = New-KeePassPassword -UpperCase -LowerCase -Digits -SpecialCharacters -Minus -UnderScore -Space -Brackets -Length 70 -ExcludeCharacters '1,],-a' -SaveAs 'BasicExcudle1]-a'

                $SecurePass | Should BeOfType KeePassLib.Security.ProtectedString
                $SecurePass.ReadString() | Should Not Match ([regex]::Escape("^.*[1\]-a].*$"))

                $PassProfile = Get-KPPasswordProfile -PasswordProfileName 'BasicExcudle1]-a'
                $PassProfile.Name | Should Be 'BasicExcudle1]-a'
                $PassProfile.CharacterSet | Should Be 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!"#$%&''*+,./:;=?@\^`|~-_ []{}()<>'
                $PassProfile.ExcludeLookAlike | Should Be 'False'
                $PassProfile.NoRepeatingCharacters | Should Be 'False'
                $PassProfile.ExcludeCharacters | Should Be '1,],-a'
                $PassProfile.Length | Should Be 70
            }
        }

        Context "Example 3: Generate a new KeePass Password - Profile" {

            It "Example 3.1: New Password using Profile Basic20 - Valid" {
                New-KeePassPassword -PasswordProfileName 'Basic20' | Should BeOfType KeePassLib.Security.ProtectedString
            }

            It "Example 3.2: New Password using Profile BasicNoLookAlike20 - Valid" {
                New-KeePassPassword -PasswordProfileName 'BasicNoLookAlike20' | Should BeOfType KeePassLib.Security.ProtectedString
            }

            It "Example 3.3: New Password using Profile BasicNoRepeat20 - Valid" {
                New-KeePassPassword -PasswordProfileName 'BasicNoRepeat20' | Should BeOfType KeePassLib.Security.ProtectedString
            }

            It "Example 3.4: New Password using Profile BasicNoRepeatInvalid - Invalid - Does Not Exist" {
                { New-KeePassPassword -PasswordProfileName 'BasicNoRepeatInvalid' } | Should Throw
            }

            It "Example 3.5: New Password using Profile BasicExcudle1]-a - Valid" {
                $SecurePass = New-KeePassPassword -PasswordProfileName 'BasicExcudle1]-a'

                $SecurePass | Should BeOfType KeePassLib.Security.ProtectedString
                $SecurePass.ReadString() | Should Not Match ([regex]::Escape("^.*[1\]-a].*$"))
            }
        }
    }

    Describe "New-KeePassEntry - UnitTest" -Tag UnitTest {

        Context "Example 1: Creates a New KeePass Entry." {

            New-KPConfigurationFile -Force

            It "Example 1.1: Creates a New KeePass Entry - Invalid - No Profile/Default" {
                { New-KeePassEntry -KeePassEntryGroupPath 'database' -Title 'test' -UserName 'testuser' -Notes 'testnotes' -URL 'http://url.test.com' } | Should Throw 'Unable to find a default KeePass Configuration, please specify a database profile name or set a default profile.'
            }

            ## Create Profile
            New-KeePassDatabaseConfiguration -DatabaseProfileName 'SampleProfile' -DatabasePath $Global:KPTestDatabaseFile -KeyPath $Global:KPTestKeyPath

            ## Reset Test DB
            Remove-Item -Path $Global:KPTestDatabaseFile -Force
            Copy-Item -Path $Global:KPTestBackupDatabaseFile -Destination "$($PSScriptRoot)\Includes\"

            It "Example 1.2: Creates a New KeePass Entry - Valid" {
                New-KeePassEntry -KeePassEntryGroupPath 'PSKeePassTestDatabase' -Title 'test' -UserName 'testuser' -Notes 'testnotes' -URL 'http://url.test.com' -DatabaseProfileName 'SampleProfile' | Should Be $null
            }

            It "Example 1.3: Creates a New KeePass Entry - Valid - PassThru" {

                $PassThruResult = New-KeePassEntry -KeePassEntryGroupPath 'PSKeePassTestDatabase' -Title 'testPassThru' -UserName 'testuser' -Notes 'testnotes' -URL 'http://url.test.com' -DatabaseProfileName 'SampleProfile' -PassThru

                $PassThruResult.KPEntry | Should BeOfType KeePassLib.PwEntry
                $PassThruResult.KPEntry.ParentGroup.Name | Should BeLike 'PSKeePassTestDatabase'
                $PassThruResult.KPEntry.Strings.ReadSafe('Title') | Should Be 'testPassThru'
                $PassThruResult.KPEntry.Strings.ReadSafe('UserName') | Should Be 'testuser'
                $PassThruResult.KPEntry.Strings.ReadSafe('Notes') | Should Be 'testnotes'
                $PassThruResult.KPEntry.Strings.ReadSafe('URL') | Should be 'http://url.test.com'
                $PassThruResult.Expires | Should be $false
            }

            It "Example 1.4: Creates a New KeePass Entry - Invalid - Group Path does not Exist" {
                { New-KeePassEntry -KeePassEntryGroupPath 'BadPath' -Title 'test' -UserName 'testuser' -Notes 'testnotes' -URL 'http://url.test.com' -DatabaseProfileName 'SampleProfile' } | Should Throw
            }

            It "Example 1.5: Creates a New KeePass Entry with manaully specified Password - Valid" {
                New-KeePassEntry -KeePassEntryGroupPath 'PSKeePassTestDatabase' -Title 'testPass' -UserName 'testuser' -Notes 'testnotes' -URL 'http://url.test.com' -KeePassPassword $(ConvertTo-SecureString -String 'teststring' -AsPlainText -Force) -DatabaseProfileName 'SampleProfile' | Should Be $null
            }

            It "Example 1.6: Creates a New KeePass Entry with a generated Password - Valid" {
                $GeneratedPassword = New-KeePassPassword -Upper -Lower -Digits -Length 50

                New-KeePassEntry -KeePassEntryGroupPath 'PSKeePassTestDatabase' -Title 'testPass' -UserName 'testuser' -Notes 'testnotes' -URL 'http://url.test.com' -KeePassPassword $GeneratedPassword -DatabaseProfileName 'SampleProfile' | Should Be $null
            }

            It "Example 1.7: Creates a New KeePass Entry - Valid - PassThru - Icon" {

                $PassThruResult = New-KeePassEntry -KeePassEntryGroupPath 'PSKeePassTestDatabase' -Title 'testPassThruIcon' -UserName 'testuser' -Notes 'testnotes' -URL 'http://url.test.com' -DatabaseProfileName 'SampleProfile' -IconName Apple -PassThru

                $PassThruResult.KPEntry | Should BeOfType KeePassLib.PwEntry
                $PassThruResult.KPEntry.ParentGroup.Name | Should BeLike 'PSKeePassTestDatabase'
                $PassThruResult.KPEntry.Strings.ReadSafe('Title') | Should Be 'testPassThruIcon'
                $PassThruResult.KPEntry.Strings.ReadSafe('UserName') | Should Be 'testuser'
                $PassThruResult.KPEntry.Strings.ReadSafe('Notes') | Should Be 'testnotes'
                $PassThruResult.KPEntry.Strings.ReadSafe('URL') | Should Be 'http://url.test.com'
                $PassThruResult.KPEntry.IconId | Should Be 'Apple'
            }

            It "Example 1.8: Creates a New KeePass Entry - Valid - PassThru - Expires" {

                $expiryTime = Get-date
                $PassThruResult = New-KeePassEntry -KeePassEntryGroupPath 'PSKeePassTestDatabase' -Title 'testPassThruExpiry' -UserName 'testuser' -Notes 'testnotes' -URL 'http://url.test.com' -DatabaseProfileName 'SampleProfile' -IconName Apple -Expires -ExpiryTime $expiryTime -PassThru

                $PassThruResult.KPEntry | Should BeOfType KeePassLib.PwEntry
                $PassThruResult.KPEntry.ParentGroup.Name | Should BeLike 'PSKeePassTestDatabase'
                $PassThruResult.KPEntry.Strings.ReadSafe('Title') | Should Be 'testPassThruExpiry'
                $PassThruResult.KPEntry.Strings.ReadSafe('UserName') | Should Be 'testuser'
                $PassThruResult.KPEntry.Strings.ReadSafe('Notes') | Should Be 'testnotes'
                $PassThruResult.KPEntry.Strings.ReadSafe('URL') | Should Be 'http://url.test.com'
                $PassThruResult.KPEntry.IconId | Should Be 'Apple'
                $PassThruResult.Expires | Should be $true
                $PassThruResult.ExpireTime | Should be $expiryTime.ToUniversalTime()
            }

            Update-KeePassDatabaseConfiguration -DatabaseProfileName 'SampleProfile' -Default

            It "Example 1.9: Creates a New KeePass Entry - Valid - PassThru using Default Profile" {

                $PassThruResult = New-KeePassEntry -KeePassEntryGroupPath 'PSKeePassTestDatabase' -Title 'testPassThru1' -UserName 'testuser1' -Notes 'testnotes' -URL 'http://url.test.com' -PassThru

                $PassThruResult.KPEntry | Should BeOfType KeePassLib.PwEntry
                $PassThruResult.KPEntry.ParentGroup.Name | Should BeLike 'PSKeePassTestDatabase'
                $PassThruResult.KPEntry.Strings.ReadSafe('Title') | Should Be 'testPassThru1'
                $PassThruResult.KPEntry.Strings.ReadSafe('UserName') | Should Be 'testuser1'
                $PassThruResult.KPEntry.Strings.ReadSafe('Notes') | Should Be 'testnotes'
                $PassThruResult.KPEntry.Strings.ReadSafe('URL') | Should be 'http://url.test.com'
                $PassThruResult.Expires | Should be $false
            }
        }

        New-KPConfigurationFile -Force
    }

    Describe "Get-KeePassEntry - UnitTest" -Tag UnitTest {

        Context "Example 1: Gets KeePass Entries." {

            New-KPConfigurationFile -Force

            It "Example 1.1: Gets All KeePass Entries - Invalid - No Database Configuration Profiles." {

                { Get-KeePassEntry -KeePassEntryGroupPath 'PSKeePassTestDatabase/BadPath' } | Should Throw 'Unable to find a default KeePass Configuration, please specify a database profile name or set a default profile.'
            }

            ## Create Profile
            New-KeePassDatabaseConfiguration -DatabaseProfileName 'SampleProfile' -DatabasePath $Global:KPTestDatabaseFile -KeyPath $Global:KPTestKeyPath

            ## Reset Test DB
            Remove-Item -Path $Global:KPTestDatabaseFile -Force
            Copy-Item -Path $Global:KPTestBackupDatabaseFile -Destination "$($PSScriptRoot)\Includes\"

            It "Example 1.2 Gets All KeePass Entries - Valid" {
                $ResultEntries = Get-KeePassEntry -DatabaseProfileName SampleProfile
                $ResultEntries.Count | Should Be 2
            }

            It "Example 1.2 Gets All KeePass Entries - MasterKey Profile - Valid" {
                New-KeePassDatabaseConfiguration -DatabaseProfileName 'MasterKeyTest' -DatabasePath "$PSScriptRoot\Includes\AuthenticationDatabases\MasterKey.kdbx" -UseMasterKey | Should Be $null
                $ResultEntries = Get-KeePassEntry -DatabaseProfileName 'MasterKeyTest' -MasterKey $(ConvertTo-SecureString -String "ATestPassWord" -AsPlainText -Force)
                $ResultEntries.Count | Should Be 2
            }

            It "Example 1.3 Gets All KeePass Entries - Valid As Plain Text" {
                $ResultEntries = Get-KeePassEntry -DatabaseProfileName SampleProfile
                $ResultEntries.Count | Should Be 2
                $ResultEntries[0].Title | Should Be 'Sample Entry'
                $ResultEntries[1].Title | Should Be 'Sample Entry #2'
            }

            It "Example 1.4: Gets All KeePass Entries Of Specific Group - Valid" {

                New-KeePassEntry -KeePassEntryGroupPath 'PSKeePassTestDatabase/General' -Title 'SubGroupTest' -UserName 'testuser' -Notes 'testnotes' -URL 'http://url.test.com' -DatabaseProfileName 'SampleProfile' | Should Be $null

                $ResultEntries = Get-KeePassEntry -DatabaseProfileName SampleProfile -KeePassEntryGroupPath 'PSKeePassTestDatabase/General'
                $ResultEntries.Title | Should Be 'SubGroupTest'
            }

            It "Example 1.5: Gets All KeePass Entries Of Specific Group - Invalid - Bad Path" {

                { Get-KeePassEntry -DatabaseProfileName SampleProfile -KeePassEntryGroupPath 'PSKeePassTestDatabase/BadPath' } | Should Throw
            }

            Update-KeePassDatabaseConfiguration -DatabaseProfileName 'SampleProfile' -Default

            It "Example 1.6 Gets All KeePass Entries - Valid - default profile" {
                $ResultEntries = Get-KeePassEntry
                $ResultEntries.Count | Should Be 3
            }
        }

        New-KPConfigurationFile -Force
    }

    Describe "Update-KeePassEntry - UnitTest" -Tag UnitTest {

        Context "Example 1: Updates a KeePass Entry." {

            New-KPConfigurationFile -Force

            It "Example 1.1: Creates a New KeePass Entry - Invalid - No Profile" {
                { Update-KeePassEntry -KeePassEntry $( New-Object KeePassLib.PwEntry($true, $true)) -KeePassEntryGroupPath 'database' -Title 'test' -UserName 'testuser' -Notes 'testnotes' -URL 'http://url.test.com' } | Should Throw 'Unable to find a default KeePass Configuration, please specify a database profile name or set a default profile.'
            }

            ## Create Profile
            New-KeePassDatabaseConfiguration -DatabaseProfileName 'SampleProfile' -DatabasePath $Global:KPTestDatabaseFile -KeyPath $Global:KPTestKeyPath

            ## Reset Test DB
            Remove-Item -Path $Global:KPTestDatabaseFile -Force
            Copy-Item -Path $Global:KPTestBackupDatabaseFile -Destination "$($PSScriptRoot)\Includes\"

            It "Example 1.2: Updates a KeePass Entry - Valid - Properties" {
                New-KeePassEntry -KeePassEntryGroupPath 'PSKeePassTestDatabase' -Title 'test1' -UserName 'testuser' -Notes 'testnotes' -URL 'http://url.test.com' -DatabaseProfileName 'SampleProfile' | Should Be $null
                $KeePassEntry = Get-KeePassEntry -KeePassEntryGroupPath 'PSKeePassTestDatabase' -DatabaseProfileName 'SampleProfile' | Where-Object { $_.Title -eq 'test1' }
                Update-KeePassEntry -KeePassEntry $KeePassEntry -KeePassEntryGroupPath 'PSKeePassTestDatabase' -title 'UpdateTest1' -UserName 'UpdateTestUser' -Notes 'UpdateTestNotes' -URL 'http://UpdateURL.Test.com' -DatabaseProfileName 'SampleProfile' -Force | Should Be $null
            }

            It "Example 1.3: Updates a KeePass Entry - Valid - Properties - Via Pipeline" {
                New-KeePassEntry -KeePassEntryGroupPath 'PSKeePassTestDatabase' -Title 'test2' -UserName 'testuser' -Notes 'testnotes' -URL 'http://url.test.com' -DatabaseProfileName 'SampleProfile' | Should Be $null
                Get-KeePassEntry -KeePassEntryGroupPath 'PSKeePassTestDatabase' -DatabaseProfileName 'SampleProfile' | Where-Object { $_.Title -eq 'test2' } |
                    Update-KeePassEntry -KeePassEntryGroupPath 'PSKeePassTestDatabase' -title 'UpdateTest2' -UserName 'UpdateTestUser' -Notes 'UpdateTestNotes' -URL 'http://UpdateURL.Test.com' -Force | Should Be $null
            }

            It "Example 1.4: Update a KeePass Entry - Valid - Properties - PassThru" {

                New-KeePassEntry -KeePassEntryGroupPath 'PSKeePassTestDatabase' -Title 'test3' -UserName 'testuser' -Notes 'testnotes' -URL 'http://url.test.com' -DatabaseProfileName 'SampleProfile' | Should Be $null
                $KeePassEntry = Get-KeePassEntry -KeePassEntryGroupPath 'PSKeePassTestDatabase' -DatabaseProfileName 'SampleProfile' | Where-Object { $_.Title -eq 'test3' }
                $UpdatePassThruResult = Update-KeePassEntry -KeePassEntryGroupPath 'PSKeePassTestDatabase' -KeePassEntry $KeePassEntry -title 'UpdateTest3' -UserName 'UpdateTestUser' -Notes 'UpdateTestNotes' -URL 'http://UpdateURL.Test.com' -DatabaseProfileName 'SampleProfile' -PassThru -Force

                $UpdatePassThruResult.KPEntry | Should BeOfType KeePassLib.PwEntry
                $UpdatePassThruResult.KPEntry.Strings.ReadSafe('Title') | Should Be 'UpdateTest3'
                $UpdatePassThruResult.KPEntry.Strings.ReadSafe('UserName') | Should Be 'UpdateTestUser'
                $UpdatePassThruResult.KPEntry.Strings.ReadSafe('Notes') | Should Be 'UpdateTestNotes'
                $UpdatePassThruResult.KPEntry.Strings.ReadSafe('URL') | Should Be 'http://UpdateURL.Test.com'
            }

            It "Example 1.5: Update a KeePass Entry - Valid - Group & Properties - PassThru" {

                New-KeePassEntry -KeePassEntryGroupPath 'PSKeePassTestDatabase' -Title 'test4' -UserName 'testuser' -Notes 'testnotes' -URL 'http://url.test.com' -DatabaseProfileName 'SampleProfile' | Should Be $null
                $KeePassEntry = Get-KeePassEntry -KeePassEntryGroupPath 'PSKeePassTestDatabase' -DatabaseProfileName 'SampleProfile' | Where-Object { $_.Title -eq 'test4' }
                $UpdatePassThruResult = Update-KeePassEntry -KeePassEntry $KeePassEntry -title 'UpdateTest4' -UserName 'UpdateTestUser' -Notes 'UpdateTestNotes' -URL 'http://UpdateURL.Test.com' -KeePassEntryGroupPath 'PSKeePassTestDatabase/General' -DatabaseProfileName 'SampleProfile' -PassThru -Force

                $UpdatePassThruResult.KPEntry | Should BeOfType KeePassLib.PwEntry
                $UpdatePassThruResult.KPEntry.ParentGroup.Name | Should Be 'General'
                $UpdatePassThruResult.KPEntry.Strings.ReadSafe('Title') | Should Be 'UpdateTest4'
                $UpdatePassThruResult.KPEntry.Strings.ReadSafe('UserName') | Should Be 'UpdateTestUser'
                $UpdatePassThruResult.KPEntry.Strings.ReadSafe('Notes') | Should Be 'UpdateTestNotes'
                $UpdatePassThruResult.KPEntry.Strings.ReadSafe('URL') | Should Be 'http://UpdateURL.Test.com'
            }

            It "Example 1.6: Update a KeePass Entry - Invalid - Group & Properties - PassThru - BadPath" {

                New-KeePassEntry -KeePassEntryGroupPath 'PSKeePassTestDatabase' -Title 'test5' -UserName 'testuser' -Notes 'testnotes' -URL 'http://url.test.com' -DatabaseProfileName 'SampleProfile' | Should Be $null
                $KeePassEntry = Get-KeePassEntry -KeePassEntryGroupPath 'PSKeePassTestDatabase' -DatabaseProfileName 'SampleProfile' | Where-Object { $_.Title -eq 'test5' }
                { Update-KeePassEntry -KeePassEntry $KeePassEntry -title 'UpdateTest5' -UserName 'UpdateTestUser' -Notes 'UpdateTestNotes' -URL 'http://UpdateURL.Test.com' -KeePassEntryGroupPath 'PSKeePassTestDatabase/BadPath' -DatabaseProfileName 'SampleProfile' -PassThru -Force } | Should Throw
            }

            It "Example 1.7: Update a KeePass Entry - Valid - Properties - PassThru - Icon" {

                New-KeePassEntry -KeePassEntryGroupPath 'PSKeePassTestDatabase' -Title 'test6' -UserName 'testuser' -Notes 'testnotes' -URL 'http://url.test.com' -DatabaseProfileName 'SampleProfile' | Should Be $null
                $KeePassEntry = Get-KeePassEntry -KeePassEntryGroupPath 'PSKeePassTestDatabase' -DatabaseProfileName 'SampleProfile' | Where-Object { $_.Title -eq 'test6' }
                $UpdatePassThruResult = Update-KeePassEntry -KeePassEntryGroupPath 'PSKeePassTestDatabase' -KeePassEntry $KeePassEntry -title 'UpdateTest6' -UserName 'UpdateTestUser' -Notes 'UpdateTestNotes' -URL 'http://UpdateURL.Test.com' -DatabaseProfileName 'SampleProfile' -IconName Apple -PassThru -Force

                $UpdatePassThruResult.KPEntry | Should BeOfType KeePassLib.PwEntry
                $UpdatePassThruResult.KPEntry.Strings.ReadSafe('Title') | Should Be 'UpdateTest6'
                $UpdatePassThruResult.KPEntry.Strings.ReadSafe('UserName') | Should Be 'UpdateTestUser'
                $UpdatePassThruResult.KPEntry.Strings.ReadSafe('Notes') | Should Be 'UpdateTestNotes'
                $UpdatePassThruResult.KPEntry.Strings.ReadSafe('URL') | Should Be 'http://UpdateURL.Test.com'
                $UpdatePassThruResult.IconId | Should Be 'Apple'
            }

            It "Example 1.8: Update a KeePass Entry - Valid - Properties - PassThru - Expires" {

                $expiryTime = Get-Date
                New-KeePassEntry -KeePassEntryGroupPath 'PSKeePassTestDatabase' -Title 'test7' -UserName 'testuser' -Notes 'testnotes' -URL 'http://url.test.com' -DatabaseProfileName 'SampleProfile' | Should Be $null
                $KeePassEntry = Get-KeePassEntry -KeePassEntryGroupPath 'PSKeePassTestDatabase' -DatabaseProfileName 'SampleProfile' | Where-Object { $_.Title -eq 'test7' }
                $UpdatePassThruResult = Update-KeePassEntry -KeePassEntryGroupPath 'PSKeePassTestDatabase' -KeePassEntry $KeePassEntry -title 'UpdateTest7' -UserName 'UpdateTestUser' -Notes 'UpdateTestNotes' -URL 'http://UpdateURL.Test.com' -DatabaseProfileName 'SampleProfile' -IconName Apple -Expires -ExpiryTime $expiryTime -PassThru -Force

                $UpdatePassThruResult.KPEntry | Should BeOfType KeePassLib.PwEntry
                $UpdatePassThruResult.KPEntry.Strings.ReadSafe('Title') | Should Be 'UpdateTest7'
                $UpdatePassThruResult.KPEntry.Strings.ReadSafe('UserName') | Should Be 'UpdateTestUser'
                $UpdatePassThruResult.KPEntry.Strings.ReadSafe('Notes') | Should Be 'UpdateTestNotes'
                $UpdatePassThruResult.KPEntry.Strings.ReadSafe('URL') | Should Be 'http://UpdateURL.Test.com'
                $UpdatePassThruResult.IconId | Should Be 'Apple'
                $UpdatePassThruResult.Expires | Should be $true
                $UpdatePassThruResult.ExpireTime | should be $expiryTime.ToUniversalTime()
            }

            Update-KeePassDatabaseConfiguration -DatabaseProfileName 'SampleProfile' -Default

            It "Example 1.9: Updates a KeePass Entry - Valid - Properties - Default Profile" {
                New-KeePassEntry -KeePassEntryGroupPath 'PSKeePassTestDatabase' -Title 'test1' -UserName 'testuser' -Notes 'testnotes' -URL 'http://url.test.com'| Should Be $null
                $KeePassEntry = Get-KeePassEntry -KeePassEntryGroupPath 'PSKeePassTestDatabase' | Where-Object { $_.Title -eq 'test1' }
                Update-KeePassEntry -KeePassEntry $KeePassEntry -KeePassEntryGroupPath 'PSKeePassTestDatabase' -title 'UpdateTest1' -UserName 'UpdateTestUser' -Notes 'UpdateTestNotes' -URL 'http://UpdateURL.Test.com' -Force | Should Be $null
            }
        }
        New-KPConfigurationFile -Force
    }

    Describe "Remove-KeePassEntry - UnitTest" -Tag UnitTest {
        New-KPConfigurationFile -Force

        Context "Example 1: Remove a KeePass Entry" {

            It "Example 1.1: Removes a KeePass Entry - Invalid - No Profile" {
                { Remove-KeePassEntry -KeePassEntry $( New-Object KeePassLib.PwEntry($true, $true)) }| Should Throw 'Unable to find a default KeePass Configuration, please specify a database profile name or set a default profile.'
            }

            ## Create Profile
            New-KeePassDatabaseConfiguration -DatabaseProfileName 'SampleProfile' -DatabasePath $Global:KPTestDatabaseFile -KeyPath $Global:KPTestKeyPath

            ## Reset Test DB
            Remove-Item -Path $Global:KPTestDatabaseFile -Force
            Copy-Item -Path $Global:KPTestBackupDatabaseFile -Destination "$($PSScriptRoot)\Includes\"

            It "Example 1.2: Removes a KeePass Entry - Valid " {
                New-KeePassEntry -KeePassEntryGroupPath 'PSKeePassTestDatabase' -Title 'test1' -UserName 'testuser' -Notes 'testnotes' -URL 'http://url.test.com' -DatabaseProfileName 'SampleProfile' | Should Be $null
                $KeePassEntry = Get-KeePassEntry -KeePassEntryGroupPath 'PSKeePassTestDatabase' -DatabaseProfileName 'SampleProfile' | Where-Object { $_.Title -eq 'test1' }
                Remove-KeePassEntry -KeePassEntry $KeePassEntry -DatabaseProfileName 'SampleProfile' -Force | Should Be $null
            }

            It "Example 1.3: Removes a KeePass Entry - Valid - NoRecycle " {
                New-KeePassEntry -KeePassEntryGroupPath 'PSKeePassTestDatabase' -Title 'test2' -UserName 'testuser' -Notes 'testnotes' -URL 'http://url.test.com' -DatabaseProfileName 'SampleProfile' | Should Be $null
                $KeePassEntry = Get-KeePassEntry -KeePassEntryGroupPath 'PSKeePassTestDatabase' -DatabaseProfileName 'SampleProfile' | Where-Object { $_.Title -eq 'test2' }
                Remove-KeePassEntry -KeePassEntry $KeePassEntry -DatabaseProfileName 'SampleProfile' -NoRecycle -Force | Should Be $null
            }

            It "Example 1.4: Removes a KeePass Entry - Valid - Pipeline " {
                New-KeePassEntry -KeePassEntryGroupPath 'PSKeePassTestDatabase' -Title 'test3' -UserName 'testuser' -Notes 'testnotes' -URL 'http://url.test.com' -DatabaseProfileName 'SampleProfile' | Should Be $null
                $KeePassEntry = Get-KeePassEntry -KeePassEntryGroupPath 'PSKeePassTestDatabase' -DatabaseProfileName 'SampleProfile' | Where-Object { $_.Title -eq 'test3' }
                $KeePassEntry | Remove-KeePassEntry -Force | Should Be $null
            }

            It "Example 1.5: Removes a KeePass Entry - Valid - Pipeline - PWEntry" {
                New-KeePassEntry -KeePassEntryGroupPath 'PSKeePassTestDatabase' -Title 'test4' -UserName 'testuser' -Notes 'testnotes' -URL 'http://url.test.com' -DatabaseProfileName 'SampleProfile' | Should Be $null
                $KeePassEntry = Get-KeePassEntry -KeePassEntryGroupPath 'PSKeePassTestDatabase' -DatabaseProfileName 'SampleProfile' | Where-Object { $_.KPEntry.Strings.ReadSafe('Title') -eq 'test4' }
                $KeePassEntry | Remove-KeePassEntry -Force | Should Be $null
            }

            Update-KeePassDatabaseConfiguration -DatabaseProfileName 'SampleProfile' -Default

            It "Example 1.6: Removes a KeePass Entry - Valid - Default Profile " {
                New-KeePassEntry -KeePassEntryGroupPath 'PSKeePassTestDatabase' -Title 'test1' -UserName 'testuser' -Notes 'testnotes' -URL 'http://url.test.com' | Should Be $null
                $KeePassEntry = Get-KeePassEntry -KeePassEntryGroupPath 'PSKeePassTestDatabase' | Where-Object { $_.Title -eq 'test1' }
                Remove-KeePassEntry -KeePassEntry $KeePassEntry -Force | Should Be $null
            }
        }

        New-KPConfigurationFile -Force
    }

    Describe "New-KeePassGroup - UnitTest" -Tag UnitTest {

        Context "Example 1: Creates a New KeePass Group." {

            New-KPConfigurationFile -Force

            It "Example 1.1: Creates a New KeePass Group - Invalid - No Profile" {
                { New-KeePassGroup -KeePassGroupParentPath 'database' -KeePassGroupName 'test' } | Should Throw 'Unable to find a default KeePass Configuration, please specify a database profile name or set a default profile.'
            }

            ## Create Profile
            New-KeePassDatabaseConfiguration -DatabaseProfileName 'SampleProfile' -DatabasePath $Global:KPTestDatabaseFile -KeyPath $Global:KPTestKeyPath

            ## Reset Test DB
            Remove-Item -Path $Global:KPTestDatabaseFile -Force
            Copy-Item -Path $Global:KPTestBackupDatabaseFile -Destination "$($PSScriptRoot)\Includes\"

            It "Example 1.2: Creates a New KeePass Group - Valid" {
                New-KeePassGroup -KeePassGroupParentPath 'PSKeePassTestDatabase' -KeePassGroupName 'test1' -DatabaseProfileName 'SampleProfile' | Should Be $null
            }

            It "Example 1.3: Creates a New KeePass Group - Valid - PassThru" {

                $PassThruResult = New-KeePassGroup -KeePassGroupParentPath 'PSKeePassTestDatabase' -KeePassGroupName 'test2PassThru' -DatabaseProfileName 'SampleProfile' -Notes 'testnotes' -PassThru

                $PassThruResult.psobject.TypeNames -icontains 'PSKeePass.Group' | Should Be $true
                $PassThruResult.ParentGroup | Should Be 'PSKeePassTestDatabase'
                $PassThruResult.Name | Should Be 'test2PassThru'
                $PassThruResult.Notes | Should Be 'testnotes'
            }

            It "Example 1.4: Creates a New KeePass Entry - Invalid - Group Path does not Exist" {
                { New-KeePassGroup -KeePassGroupParentPath 'BadPath' -KeePassGroupName 'test3' -DatabaseProfileName 'SampleProfile' } | Should Throw
            }

            It "Example 1.5: Creates a New KeePass Group - Valid - PassThru - Icon" {

                $PassThruResult = New-KeePassGroup -KeePassGroupParentPath 'PSKeePassTestDatabase' -KeePassGroupName 'test4PassThru' -DatabaseProfileName 'SampleProfile' -IconName 'Clock' -PassThru

                $PassThruResult.psobject.TypeNames -icontains 'PSKeePass.Group' | Should Be $true
                $PassThruResult.ParentGroup | Should Be 'PSKeePassTestDatabase'
                $PassThruResult.Name | Should Be 'test4PassThru'
                $PassThruResult.IconId | Should Be 'Clock'
            }

            It "Example 1.6: Creates a New KeePass Group - Valid - PassThru - Expires" {

                $expiryTime = Get-Date
                $PassThruResult = New-KeePassGroup -KeePassGroupParentPath 'PSKeePassTestDatabase' -KeePassGroupName 'test5PassThru' -DatabaseProfileName 'SampleProfile' -IconName 'Clock' -Expires -ExpiryTime $expiryTime -PassThru

                $PassThruResult.psobject.TypeNames -icontains 'PSKeePass.Group' | Should Be $true
                $PassThruResult.ParentGroup | Should Be 'PSKeePassTestDatabase'
                $PassThruResult.Name | Should Be 'test5PassThru'
                $PassThruResult.IconId | Should Be 'Clock'
                $PassThruResult.Expires | Should Be $true
                $PassThruResult.ExpireTime | Should Be $expiryTime.ToUniversalTime()
            }

            Update-KeePassDatabaseConfiguration -DatabaseProfileName 'SampleProfile' -Default

            It "Example 1.7: Creates a New KeePass Group - Valid - Default Profile" {
                New-KeePassGroup -KeePassGroupParentPath 'PSKeePassTestDatabase' -KeePassGroupName 'test1' | Should Be $null
            }
        }
        New-KPConfigurationFile -Force
    }

    Describe "Get-KeePassGroup - UnitTest" -Tag UnitTest {

        Context "Example 1: Gets KeePass Groups." {

            New-KPConfigurationFile -Force

            It "Example 1.1: Gets All KeePass Groups - Invalid - No Database Configuration Profiles." {

                { Get-KeePassGroup -KeePassGroupPath 'PSKeePassTestDatabase/BadPath' } | Should Throw 'Unable to find a default KeePass Configuration, please specify a database profile name or set a default profile.'
            }

            ## Create Profile
            New-KeePassDatabaseConfiguration -DatabaseProfileName 'SampleProfile' -DatabasePath $Global:KPTestDatabaseFile -KeyPath $Global:KPTestKeyPath

            ## Reset Test DB
            Remove-Item -Path $Global:KPTestDatabaseFile -Force
            Copy-Item -Path $Global:KPTestBackupDatabaseFile -Destination "$($PSScriptRoot)\Includes\"

            It "Example 1.2 Gets All KeePass Groups - Valid" {
                $ResultGroups = Get-KeePassGroup -DatabaseProfileName SampleProfile
                $ResultGroups.Count | Should Be 7
            }

            It "Example 1.3 Gets All KeePass Groups - Valid As Plain Text" {
                $ResultGroups = Get-KeePassGroup -DatabaseProfileName SampleProfile
                $ResultGroups.Count | Should Be 7
            }

            It "Example 1.4: Gets a KeePass Group - Valid" {

                $ResultGroups = Get-KeePassGroup -DatabaseProfileName SampleProfile -KeePassGroupPath 'PSKeePassTestDatabase/General'
                $ResultGroups.Name | Should Be 'General'
                $ResultGroups.ParentGroup | Should Be 'PSKeePassTestDatabase'
            }

            It "Example 1.5: Gets a KeePass Group - Invalid - Bad Path" {

                { Get-KeePassEntry -DatabaseProfileName SampleProfile -KeePassEntryGroupPath 'PSKeePassTestDatabase/BadPath' } | Should Throw
            }

            Update-KeePassDatabaseConfiguration -DatabaseProfileName 'SampleProfile' -Default

            It "Example 1.6 Gets All KeePass Groups - Valid - Default Profile" {
                $ResultGroups = Get-KeePassGroup
                $ResultGroups.Count | Should Be 7
            }
        }

        New-KPConfigurationFile -Force
    }

    Describe "Update-KeePassGroup - UnitTest" -Tag UnitTest {

        Context "Example 1: Updates a KeePass Group." {

            New-KPConfigurationFile -Force

            It "Example 1.1: Updates a KeePass Group - Invalid - No Profile" {
                { Update-KeePassGroup -KeePassGroup $( New-Object KeePassLib.PwGroup($true, $true)) -Force } | Should Throw 'Unable to find a default KeePass Configuration, please specify a database profile name or set a default profile.'
            }

            ## Create Profile
            New-KeePassDatabaseConfiguration -DatabaseProfileName 'SampleProfile' -DatabasePath $Global:KPTestDatabaseFile -KeyPath $Global:KPTestKeyPath

            ## Reset Test DB
            Remove-Item -Path $Global:KPTestDatabaseFile -Force
            Copy-Item -Path $Global:KPTestBackupDatabaseFile -Destination "$($PSScriptRoot)\Includes\"

            It "Example 1.2: Updates a KeePass Group - Valid - Name" {
                New-KeePassGroup -KeePassGroupParentPath 'PSKeePassTestDatabase' -KeePassGroupName 'test1' -DatabaseProfileName 'SampleProfile' | Should Be $null
                $KeePassGroup = Get-KeePassGroup -DatabaseProfileName SampleProfile -KeePassGroupPath 'PSKeePassTestDatabase/test1'
                $KeePassGroup.Name | Should Be 'test1'
                Update-KeePassGroup -KeePassGroup $KeePassGroup -GroupName 'Test1Update' -DatabaseProfileName 'SampleProfile' -Force | Should Be $null
                $KeePassGroup = Get-KeePassGroup -DatabaseProfileName SampleProfile -KeePassGroupPath 'PSKeePassTestDatabase/Test1Update'
                $KeePassGroup.Name | Should Be 'Test1Update'
            }

            It "Example 1.3: Updates a KeePass Group - Valid - Name" {
                New-KeePassGroup -KeePassGroupParentPath 'PSKeePassTestDatabase' -KeePassGroupName 'test2' -DatabaseProfileName 'SampleProfile' | Should Be $null
                Get-KeePassGroup -DatabaseProfileName SampleProfile -KeePassGroupPath 'PSKeePassTestDatabase/test2' |
                    Update-KeePassGroup -GroupName 'Test2Update' -Force | Should Be $null
                $KeePassGroup = Get-KeePassGroup -DatabaseProfileName SampleProfile -KeePassGroupPath 'PSKeePassTestDatabase/Test2Update'
                $KeePassGroup.Name | Should Be 'Test2Update'
            }

            It "Example 1.4: Updates a KeePass Group - Valid - Name" {
                New-KeePassGroup -KeePassGroupParentPath 'PSKeePassTestDatabase' -KeePassGroupName 'test3' -DatabaseProfileName 'SampleProfile' | Should Be $null
                $KeePassGroup = Get-KeePassGroup -DatabaseProfileName SampleProfile -KeePassGroupPath 'PSKeePassTestDatabase/test3'
                $KeePassGroup.Name | Should Be 'test3'
                $KeePassGroup = Update-KeePassGroup -KeePassGroup $KeePassGroup -GroupName 'Test3Update' -DatabaseProfileName 'SampleProfile' -Force -PassThru
                $KeePassGroup.Name | Should Be 'Test3Update'
                $KeePassGroup.psobject.TypeNames -icontains 'PSKeePass.Group' | Should Be $true
                $KeePassGroup.ParentGroup | Should be 'PSKeePassTestDatabase'
            }

            It "Example 1.5: Updates a KeePass Group - Valid - ParentGroup - Pipeline" {
                New-KeePassGroup -KeePassGroupParentPath 'PSKeePassTestDatabase' -KeePassGroupName 'test4' -DatabaseProfileName 'SampleProfile' | Should Be $null
                Get-KeePassGroup -DatabaseProfileName SampleProfile -KeePassGroupPath 'PSKeePassTestDatabase/test4' |
                    Update-KeePassGroup -KeePassParentGroupPath 'PSKeePassTestDatabase/General' -Force | Should Be $null
                $KeePassGroup = Get-KeePassGroup -DatabaseProfileName SampleProfile -KeePassGroupPath 'PSKeePassTestDatabase/General/test4'
                $KeePassGroup.Name | Should Be 'test4'
                $KeePassGroup.ParentGroup | Should be 'General'
            }

            It "Example 1.6: Updates a KeePass Group - Invalid - ParentGroup - BadPath" {
                New-KeePassGroup -KeePassGroupParentPath 'PSKeePassTestDatabase' -KeePassGroupName 'test5' -DatabaseProfileName 'SampleProfile' | Should Be $null
                { Get-KeePassGroup -DatabaseProfileName SampleProfile -KeePassGroupPath 'PSKeePassTestDatabase/test5' |
                        Update-KeePassGroup -KeePassParentGroupPath 'PSKeePassTestDatabase/BadPath' -Force } | Should Throw
            }

            It "Example 1.7: Updates a KeePass Group - Valid - Name - PassThru - Icon" {
                New-KeePassGroup -KeePassGroupParentPath 'PSKeePassTestDatabase' -KeePassGroupName 'test6' -DatabaseProfileName 'SampleProfile' | Should Be $null
                $KeePassGroup = Get-KeePassGroup -DatabaseProfileName SampleProfile -KeePassGroupPath 'PSKeePassTestDatabase/test6'
                $KeePassGroup.Name | Should Be 'test6'
                $KeePassGroup.IconId | Should Be 'Folder'
                $KeePassGroup = Update-KeePassGroup -KeePassGroup $KeePassGroup -GroupName 'Test6Update' -DatabaseProfileName 'SampleProfile' -IconName 'Clock' -Force -PassThru
                $KeePassGroup.Name | Should Be 'Test6Update'
                $KeePassGroup.IconId | Should Be 'Clock'
                $KeePassGroup.psobject.TypeNames -icontains 'PSKeePass.Group' | Should Be $true
                $KeePassGroup.ParentGroup | Should be 'PSKeePassTestDatabase'
            }

            It "Example 1.8: Updates a KeePass Group - Valid - Name - PassThru - Expires" {
                $expiryTime = Get-Date

                New-KeePassGroup -KeePassGroupParentPath 'PSKeePassTestDatabase' -KeePassGroupName 'test7' -DatabaseProfileName 'SampleProfile' | Should Be $null
                $KeePassGroup = Get-KeePassGroup -DatabaseProfileName SampleProfile -KeePassGroupPath 'PSKeePassTestDatabase/test7'
                $KeePassGroup.Name | Should Be 'test7'
                $KeePassGroup.IconId | Should Be 'Folder'
                $KeePassGroup = Update-KeePassGroup -KeePassGroup $KeePassGroup -GroupName 'Test7Update' -DatabaseProfileName 'SampleProfile' -IconName 'Clock' -Expires -ExpiryTime $expiryTime -Force -PassThru
                $KeePassGroup.Name | Should Be 'Test7Update'
                $KeePassGroup.IconId | Should Be 'Clock'
                $KeePassGroup.psobject.TypeNames -icontains 'PSKeePass.Group' | Should Be $true
                $KeePassGroup.ParentGroup | Should be 'PSKeePassTestDatabase'
                $KeePassGroup.Expires | Should be $true
                $KeePassGroup.ExpireTime | Should be $expiryTime.ToUniversalTime()
            }

            It "Example 1.9: Updates a KeePass Group - Valid - Notes" {
                New-KeePassGroup -KeePassGroupParentPath 'PSKeePassTestDatabase' -KeePassGroupName 'test8' -DatabaseProfileName 'SampleProfile' -Notes 'meh' | Should Be $null
                $KeePassGroup = Get-KeePassGroup -DatabaseProfileName SampleProfile -KeePassGroupPath 'PSKeePassTestDatabase/test8'
                $KeePassGroup.Name | Should Be 'test8'
                $KeePassGroup.Notes | Should Be 'meh'
                $KeePassGroup = Update-KeePassGroup -KeePassGroup $KeePassGroup -GroupName 'Test8Update' -DatabaseProfileName 'SampleProfile' -Notes 'bye' -Force -PassThru
                $KeePassGroup.Name | Should Be 'Test8Update'
                $KeePassGroup.psobject.TypeNames -icontains 'PSKeePass.Group' | Should Be $true
                $KeePassGroup.ParentGroup | Should be 'PSKeePassTestDatabase'
                $KeePassGroup.Notes | Should Be 'bye'
            }

            It "Example 2.0: Updates a KeePass Group - Valid - Notes Not Passed" {
                New-KeePassGroup -KeePassGroupParentPath 'PSKeePassTestDatabase' -KeePassGroupName 'test9' -DatabaseProfileName 'SampleProfile' -Notes 'meh' | Should Be $null
                $KeePassGroup = Get-KeePassGroup -DatabaseProfileName SampleProfile -KeePassGroupPath 'PSKeePassTestDatabase/test9'
                $KeePassGroup.Name | Should Be 'test9'
                $KeePassGroup.Notes | Should Be 'meh'
                $KeePassGroup = Update-KeePassGroup -KeePassGroup $KeePassGroup -GroupName 'Test9Update' -DatabaseProfileName 'SampleProfile' -Force -PassThru
                $KeePassGroup.Name | Should Be 'Test9Update'
                $KeePassGroup.psobject.TypeNames -icontains 'PSKeePass.Group' | Should Be $true
                $KeePassGroup.ParentGroup | Should be 'PSKeePassTestDatabase'
                $KeePassGroup.Notes | Should Be 'meh'
            }

            Update-KeePassDatabaseConfiguration -DatabaseProfileName 'SampleProfile' -Default

            It "Example 2.1: Updates a KeePass Group - Valid - Name - Default Profile" {
                New-KeePassGroup -KeePassGroupParentPath 'PSKeePassTestDatabase' -KeePassGroupName 'test1' | Should Be $null
                $KeePassGroup = Get-KeePassGroup -KeePassGroupPath 'PSKeePassTestDatabase/test1'
                $KeePassGroup.Name | Should Be 'test1'
                Update-KeePassGroup -KeePassGroup $KeePassGroup -GroupName 'Test1Update' -Force | Should Be $null
                $KeePassGroup = Get-KeePassGroup -KeePassGroupPath 'PSKeePassTestDatabase/Test1Update'
                $KeePassGroup.Name | Should Be 'Test1Update'
            }
        }

        New-KPConfigurationFile -Force
    }

    Describe "Remove-KeePassGroup - UnitTest" -Tag UnitTest {
        New-KPConfigurationFile -Force

        Context "Example 1: Remove a KeePass Group" {

            It "Example 1.1: Removes a KeePass Group - Invalid - No Profile" {
                { Remove-KeePassGroup -KeePassGroup $( New-Object KeePassLib.PwGroup($true, $true)) }| Should Throw 'Unable to find a default KeePass Configuration, please specify a database profile name or set a default profile.'
            }

            ## Create Profile
            New-KeePassDatabaseConfiguration -DatabaseProfileName 'SampleProfile' -DatabasePath $Global:KPTestDatabaseFile -KeyPath $Global:KPTestKeyPath

            ## Reset Test DB
            Remove-Item -Path $Global:KPTestDatabaseFile -Force
            Copy-Item -Path $Global:KPTestBackupDatabaseFile -Destination "$($PSScriptRoot)\Includes\"

            It "Example 1.2: Removes a KeePass Group - Valid " {
                New-KeePassGroup -KeePassGroupParentPath 'PSKeePassTestDatabase' -KeePassGroupName 'test1' -DatabaseProfileName 'SampleProfile' | Should Be $null
                $KeePassGroup = Get-KeePassGroup -DatabaseProfileName SampleProfile -KeePassGroupPath 'PSKeePassTestDatabase/test1'
                $KeePassGroup.Name | Should Be 'test1'
                Remove-KeePassGroup -KeePassGroup $KeePassGroup -DatabaseProfileName 'SampleProfile' -Force | Should Be $null
                $Check = Get-KeePassGroup -DatabaseProfileName SampleProfile -KeePassGroupPath 'PSKeePassTestDatabase/RecycleBin/test1'
                $Check.Name | Should Be 'test1'
            }

            It "Example 1.3: Removes a KeePass Group - Valid - NoRecycle " {
                New-KeePassGroup -KeePassGroupParentPath 'PSKeePassTestDatabase' -KeePassGroupName 'test2' -DatabaseProfileName 'SampleProfile' | Should Be $null
                $KeePassGroup = Get-KeePassGroup -DatabaseProfileName SampleProfile -KeePassGroupPath 'PSKeePassTestDatabase/test2'
                $KeePassGroup.Name | Should Be 'test2'
                Remove-KeePassGroup -KeePassGroup $KeePassGroup -DatabaseProfileName 'SampleProfile' -NoRecycle -Force | Should Be $null
                Get-KeePassGroup -DatabaseProfileName SampleProfile -KeePassGroupPath 'PSKeePassTestDatabase/test2' | Should Be $null
                Get-KeePassGroup -DatabaseProfileName SampleProfile -KeePassGroupPath 'PSKeePassTestDatabase/RecycleBin/test2' | Should Be $null
            }

            It "Example 1.4: Removes a KeePass Group - Valid - Pipeline - AsPlainText" {
                New-KeePassGroup -KeePassGroupParentPath 'PSKeePassTestDatabase' -KeePassGroupName 'test3' -DatabaseProfileName 'SampleProfile' | Should Be $null
                $KeePassGroup = Get-KeePassGroup -DatabaseProfileName SampleProfile -KeePassGroupPath 'PSKeePassTestDatabase/test3'
                $KeePassGroup.Name | Should Be 'test3'
                $KeePassGroup | Remove-KeePassGroup -Force | Should Be $null
                Get-KeePassGroup -DatabaseProfileName SampleProfile -KeePassGroupPath 'PSKeePassTestDatabase/RecycleBin/test3' | Should Not Be $null
            }

            It "Example 1.4: Removes a KeePass Group - Valid - Pipeline - PwGroup" {
                New-KeePassGroup -KeePassGroupParentPath 'PSKeePassTestDatabase' -KeePassGroupName 'test4' -DatabaseProfileName 'SampleProfile' | Should Be $null
                $KeePassGroup = Get-KeePassGroup -DatabaseProfileName SampleProfile -KeePassGroupPath 'PSKeePassTestDatabase/test4'
                $KeePassGroup.Name | Should Be 'test4'
                $KeePassGroup | Remove-KeePassGroup -Force | Should Be $null
                Get-KeePassGroup -DatabaseProfileName SampleProfile -KeePassGroupPath 'PSKeePassTestDatabase/RecycleBin/test4' | Should Not Be $null
            }

            Update-KeePassDatabaseConfiguration -DatabaseProfileName 'SampleProfile' -Default

            It "Example 1.5: Removes a KeePass Group - Valid - Default Profile" {
                New-KeePassGroup -KeePassGroupParentPath 'PSKeePassTestDatabase' -KeePassGroupName 'test1' | Should Be $null
                $KeePassGroup = Get-KeePassGroup -KeePassGroupPath 'PSKeePassTestDatabase/test1'
                $KeePassGroup.Name | Should Be 'test1'
                Remove-KeePassGroup -KeePassGroup $KeePassGroup -Force | Should Be $null
                $Check = Get-KeePassGroup -KeePassGroupPath 'PSKeePassTestDatabase/RecycleBin/test1'
                $Check.Name | Should Be 'test1'
            }
        }

        New-KPConfigurationFile -Force
    }

    ## Reset Test DB
    Remove-Item -Path $Global:KPTestDatabaseFile -Force
    Copy-Item -Path $Global:KPTestBackupDatabaseFile -Destination "$($PSScriptRoot)\Includes\"
}

$UpdateVersion = Read-Host -Prompt 'Update Version [Y\n]'

if($UpdateVersion -ine 'N')
{
    Invoke-Expression -Command "$($PSScriptRoot)\..\bin\AutoVersion.ps1"
}

redpajama_set_name: RedPajamaGithub


text:
[Album Review] Apocalypse: Save Us (2nd Studio Album) – Dream Catcher
August 27, 2022 August 28, 2022 Posted in Album Reviews, KPOPTagged Dream Catcher
I time travel back to April this time to cover Dream Catcher's second studio album, Apocalypse: Save Us. This was released mid-April with the title track, MAISON, as its lead track. The album features two halves, one full of group tracks and the other half is made up of solo tracks from each of the members. There is also an introductory track and an interlude questionably labelled as a skit (both of which do not feature as part of the final album rating as they do not feature lyrics). In total, Apocalypse: Save Us features 14 tracks to satisfy our Dream Catcher music cravings.
Another strong album from Dream Catcher, which features a number of 10/10 tracks. Find out which songs I gave the perfect rating to down below! Honestly, I am not surprised about this. Dream Catcher has always given us strong side tracks, and Apocalypse: Save Us is not exception. I also liked that the members got to explore individual sounds with their solo tracks. As a result of this, we were given very different tracks to what we usually hear from Dream Catcher as a group. There is probably something for everyone on this album! Also, each member shot a MV (branded as a 'special clip' on their YouTube channel). I have included a link to each video, so make sure you check the videos out as well!
Apocalypse: Save Us Album Cover
1. Intro: Save Us – Beginning the album is this instrumental introductory track, which can be further broken into two halves. The first half is this haunting and sinister classical organ instrumental, and the second half is a hip guitar instrumental that feels very urban and contemporary.
2. Locked Inside a Door – Following the introductory track, we move onto the album's first 10/10 song. This album really sets itself up from the beginning. Locked Inside a Door is a groovy track thanks to its jazzy instrumental. And like most groovy numbers these days, I find myself having a bit of a dance along to the music when I hear it. I liked how both Dream Catcher embraced this jazzy side, going with some awesome vocal and rapping delivery and styles that work hand-in-hand with the genre. I also enjoyed how they were upfront, allowing their vocals to gain a stronger vibrant and appealing tinge. (10/10)
3. MAISON (Title Track) – Click here to read the full review for MAISON. (8/10)
4. Starlight – Starlight tackles the synthpop genre, and I am loving it! I found the instrumentation to be blissful and quite a vibe throughout. I really like the consistency from start to end. Most of the time, I am complaining about songs being too consistent. But Starlight definitely thrives and excels as a result of this consistent approach. The vocals align nicely, and I quite liked how the producers did an amazing job ensuring that the song matches up with the rest of Dream Catcher's discography. Dami, in particular, shines in this song. (10/10)
5. Together – Together continues the experimentation with different musical styles, this time dabbling in deep house. I liked how club ready this song is. I also enjoyed the way their vocals are kept delicate and soft, placing emphasis on breathy tones. In addition, I liked the pop of energy added to the chorus through that vibrant synth, giving the catchy sequence some depth, grooviness and allowing the chorus to be quite distinct from the rest of the song. The 'Say that you love me' repetition in the second half of the chorus is super catchy. Siyeon's high note was spectacular. I have to admit though, this sone is slightly more plain than what we have heard so far. But it still a strong number. (9/10)
6. Always – Once again, Dream Catcher changes it up the trajectory of this album with a different genre. This time, it is ballad. If you know me, I have a soft spot for ballads. And Always proves just that. Always is a beautiful instrumented ballad with stunning piano work as the basis of the instrumental. It is also complete with wonderful and captivating vocals. The swayable melodies are just to die for and adds a memorable aspect to the song. (10/10)
7. Skit: The Seven Doors – The Seven Doors acts as an interlude between the two halves of the album. The first half (what we have heard thus far) are the group songs, while the second half (what we are about to venture into) are solo tracks from each of the members. The Seven Doors itself brings it all back to their energetic rock roots which sounds appropriate as an anime soundtrack. It is squashed between an atmospheric wind intro and nature sounds as the outro. My biggest question is, however, why is The Seven Doors labelled a skit?
8. Cherry (Real Miracle) – The first solo track on the album belongs to JiU. It is a cute track about her dog named Cherry. Cuteness is not something I would ever associate with Dream Catcher, so a track like this is actually quite refreshing and different. I enjoyed the upbeat funky and groovy vibes that's Cherry (Real Miracle) had. A lovely and satisfying track, overall. (8/10)
9. No Dot – On a much more serious note is No Dot, which is SuA's solo track. This is more within Dream Catcher's wheelhouse for obvious reasons. No Dot is quite intense, thanks to the trap and rock elements in the instrumental. I also liked how the bass bolstered and added definition to the song towards the end, concentrating the darker and more intense notes of No Dot. SuA also sounds amazing, particularly when she uses her lower and breathy tones in the post-chorus hooks. (9/10)
10. Entrancing (황홀경 (极夜)) – As mentioned earlier in the review, I am a sucker for ballads. And Siyeon's solo track, Entrancing, does exactly as the title suggests. It is a ballad that is draws influences from traditional Korean music. But it is not just that. Entrancing sounds like it uses a mix of classical, traditional and modern instruments to bring the captivating effect to life. It is very unique and leaves me floored (imagine my jaws dropping to the floor). Siyeon's vocals were stunning and breathtaking throughout Entrancing, drifting along with the melodies. There was also a soft rap in the song, something I would not have expected with such a delicate song. (10/10)
11. Winter (한겨울 (寒冬)) – The next solo song (belonging to Handong) is another ballad. But this time, it takes the form of a R&B ballad. This song is quite delicate and remains quite soft throughout, reminding you of a winter's day. Personally, Winter is not my type of song. Usually, I find the style dry and Winter did fall into that trap. Handong does surprise me at the end with an acapella ending that did perk my interest. Also interesting is that she ended the Korean centric song with Chinese lyrics. (7.5/10)
12. For – Yoohyeon's solo track, For, is an old time jazzy number. The track is well executed. From the jazzy instrumental to the sweet vocals from Yoohyeon, everything was on point and sounded ideal for the direction in which the influences had directed the song to go towards. What was quite unexpected was the fact majority of For is in English (sans a couple of Korean words in the choruses). To me, that is quite a surprise and give Yoohyeon a unique edge with her solo track (when compared to the other members). (8/10)
13. Beauty Full – Beauty Full is up next, headed by Dami. I have high expectations with her solo track, simply because she is my favourite member of the group! Consider Beauty Full to hit those expectations! Her track taps into the pop rock genre that has been in abundance in KPOP with some more recent releases. Beauty Full is pretty nostalgic for me (as are the other pop rock KPOP tracks), as pop rock is what I grew up with. I liked the vibrant energy that is coming from the song, with some really satisfying head nodding sequences. Dami's vocals are superb and her rapping is top notch (per usual). The anthem direction of the bridge was very cool, as well. I might be bias heading into this track, but I leave happy and satisfied. (10/10)
14. Playground – We end the lengthy album with a vibrant and cheerful track from Gahyeon. Playground is a pleasant track that makes me smile while I listen to it. It is largely pop, but there are also some funky and jazzy elements as well. I also liked the subtle violin and brass in the instrumental. Gahyeon sounds really nice throughout Playground, though I think a high note (which might be beyond her abilities) would have really added the cherry on top for me. (8/10)
Overall Album Rating – 9/10
Apocalypse: Save Us Teaser Image
One thought on "[Album Review] Apocalypse: Save Us (2nd Studio Album) – Dream Catcher"
Pingback: [Review] VISION – Dreamcatcher – KPOPREVIEWED
[Album Review] GOT7 (12th Mini Album) – GOT7
[Weekly KPOP Chart] 4th Week of August 2022

redpajama_set_name: RedPajamaCommonCrawl


In the seventeenth century, Baroque architecture and urbanism turned Rome into a theater with Catholicism in the starring role. Previously, Rome was the center of the Italian Renaissance, having adopted the role from Florence. In the movement's wake, which had diminished the Catholic Church's reputation, Pope Sixtus V led a Counter Reformation effort in the Eternal City to restore the Church to the high alter of Rome.
Three processional avenues leading to important Catholic monuments from Piazza di Popolo.
The city's ancient monuments, fountains and basilicas were envisioned as stars, sideris, from which processional avenues would radiate. These rays of starlight were carved through the winding paths upon which Rome's urbanism had developed, connecting the various symbols of Catholicism to one another both visually and physically.
In Baroque Rome, artists attempted to draw viewers into their work, while architecture made use of theatrics to interact with passersby, and urbanism heightened the experience further by linking these moments along a discernible path, thus restoring the Catholic Church's place on the center stage of the city.
Piazza San Pietro from Basilica di San Pietro.
Colonnade around Piazza San Pietro in 2011.
A century after Sixtus V embarked on his project in Rome, Pierre L'Enfant borrowed the Baroque pattern of urban order to create a plan for the capital city of a newly formed nation. Washington, D.C. was laid out as a grid bisected by diagonal streets terminating at important national landmarks. Another century later, Haussmann again revived Baroque city planning principles to rebuild Paris. Rather then organizing vistas around Catholic monuments, however, the Baron oriented his boulevards towards symbols of civic life as L'Enfant had done in D.C.
Statue of San Pietro in 2011.


text:
Bay Journal
Search the Bay Journal site:
Gilmore pledges to protect Bay; reverse Virginia's loss of wetlands
By Karl Blankenship on December 01, 1997
Comments are closed for this article.
Virginia Gov.-elect James Gilmore says that he will be "the primary steward of the Chesapeake Bay" in Virginia, and that by the time he leaves office, the state will have reversed its "progressive loss" of wetlands.
Gilmore, a Republican who triumphed in the state's Nov. 4 election, will become the newest member of the Chesapeake Executive Council, the policy-making body that guides the Bay restoration effort. Though the environment was not a major theme in the election, both Gilmore and his Democratic opponent, Donald Beyer, appeared before the Virginia Environmental Assembly in October to discuss environmental policy.
As governor, Gilmore told the audience that his top environmental objectives were "an unwavering commitment to restoring the Chesapeake Bay, a comprehensive set of plans for pollution prevention, and a partnership with local governments to control the harmful effects of urban sprawl."
Gilmore said he would take responsibility for implementing Virginia's tributary strategy for reducing nutrient pollution in the Potomac River, which was completed this year, and that he agreed the state should help finance implementing the strategy.
Gilmore said local governments should be given the authority to exempt wetlands and stream buffers from property taxes. He said he would also promote the use of conservation easements by local governments as part of an effort to contain urban sprawl.
Saying Virginia needs a voluntary goal of "zero discharge into the environment," Gilmore said he planned to expand staffing in the Department of Environmental Quality's pollution prevention office from three to "at least" 10.
He promised that when he left office, "Virginia will have more net acres of wetlands ... than it does today," though he did not outline a specific program to accomplish that.
Gilmore said he would "work to control air pollution in the Chesapeake Bay airshed." But when asked whether he supported the EPA's new standards for ozone and particulates, which would force additional reductions in nitrogen oxide emissions, he did not take a position, saying only that he would "hold the EPA" to its commitment "to a flexible common sense and cost-effective implementation plan."
He said he would not support mandatory regulations on farmers to control nutrient runoff "unless we find that the voluntary procedures are not working." But he said he supported a study to determine whether intensive, large-scale animal operations should be held to a different standard than small family farms.
Gilmore also said the state DEQ "needs a period of stability." Since its creation in 1993, the agency has gone through a series of reorganizations which critics say have hurt its effectiveness, cut employee morale and caused the departure of many senior officials.
Gilmore declined to say who he would name to top environmental positions.
During the summer, as polls showed Gilmore and Beyer in a dead heat, Gilmore pledged that he would replace Natural Resources Secretary Becky Norton Dunlop, who had been a lightning rod for criticism by environmentalists who charged she was weakening environmental programs in the state.
The move was seen as an attempt to distance himself from the environmental policies of Gov. George Allen. But after the statement was criticized by conservatives within the party, among whom Dunlop is particularly popular, Gilmore quickly said that he had no serious policy differences with the Allen administration.
As attorney general, several of Gilmore's actions were criticized by environmentalists, including his losing argument in federal court that sought to restrict the ability of citizens to sue over certain environmental issues. Critics also charged that he only filed suit against Smithfield Foods, charged with seriously polluting a Bay tributary, after it became clear that the EPA was going to take action.
But Gilmore noted that as attorney general, he helped to secure large fines from several major polluters, including the 1993 Colonial Pipeline spill into a Potomac River tributary, the Avtek Superfund site in Front Royal and a coal slurry spill in the southwest corner of the state. Penalties in each of those cases exceeded $1 million.
If you enjoy our reporting, sign up for a free subscription.
About Karl Blankenship
Karl Blankenship is editor of the Bay Journal and executive director of Bay Journal Media. He has served as editor of the Bay Journal since its inception in 1991. .(JavaScript must be enabled to view this email address).
Read more articles by Karl Blankenship
By submitting a comment, you are consenting to these Rules of Conduct. Thank you for your civil participation. Please note: reader comments do not represent the position of Chesapeake Media Service.
Comments are now closed for this article. Comments are accepted for 60 days after publication.
Bay Journal is published by Bay Journal Media to inform the public about issues and events that affect the Chesapeake Bay.
Subscribe to the monthly print edition or weekly email news, both free of charge.
Copyright ©2020 Bay Journal / Bay Journal Media / Advertise with Us


text:
(5595) Roth est un astéroïde de la ceinture principale d'astéroïdes.

Description
(5595) Roth est un astéroïde de la ceinture principale. Il fut découvert le  à l'observatoire Palomar par Henry E. Holt. Il présente une orbite caractérisée par un demi-grand axe de 2,73 UA, une excentricité de 0,16 et une inclinaison de 9,8° par rapport à l'écliptique.

Compléments

Articles connexes
 Liste des planètes mineures (5001-6000)
 Ceinture d'astéroïdes

Références

Planète mineure découverte en 1991
Astéroïde de la ceinture principale
Objet céleste découvert par Henry E. Holt
Objet céleste découvert à l'observatoire Palomar

redpajama_set_name: RedPajamaWikipedia


This ballet is an age-old favourite, dating back to 1960, but after nearly 60 years, has La Fille Mal Gardee lost any of its charm?
Returning to Birmingham Hippodrome, this ballet that was created by master choreographer Frederick Ashton is part of the latest tour by Birmingham Royal Ballet (BRB).
I caught it in Birmingham, where it stays until Saturday before continuing on to theatres including The Lowry in Salford, Theatre Royal Plymouth and Sadler's Wells in London.
It's a big production with three different sets, a big cast of dancers, some endearing special effects and even a Shetland pony. In fact, this show was been going on for so long that I have it on good authority that the pony used is a direct descendant of the original one used in the Ashton premiere in 1960.
Although Ashton created over 100 works, this ballet is close to many dancers' hearts as it is fun, frivolous and gives an opportunity for some great character acting.
Set in the countryside, it follows sprightly young Lise as she avoids the matchmaking antics of her widowed mother, Simone. Simone wants Lise to marry the oafish son of the local rich man rather than follow her heart and wed a poor but handsome cheeky young farmer.
What's lovely about this ballet is that it's a light-hearted romance with bursts of comedy too. Everything about it is delightful and fun including the dancing, whether it's a maypole dance or clever routines with ribbons. There's also thoroughly endearing pas du deuxs between the two lovers. The sequence where Lise is embraced tenderly and swayed from side to side through the front door is so beautifully choreographed. It would melt the coldest of hearts.
Setting the breezy mood is the staging, which consists of cartoon drawings in pastel shades. Meanwhile, chickens dance around the stage and reappear at various points. There's wonderful pantomime characters too of Lise's mother Simone and the idiotic Alain, son of the wealthy vineyard owner.
These two provide light relief yet also some remarkable dancing sequences that need an awful lot of technique to look so bad. Simone has the famous 'clog dance' while Alain has quirky moves and solos that are always a pleasure.
Playing Simone, in drag, is experienced Michael O'Hare, who is now a senior ballet master as well. Many may remember him in another character-led role of Dr Coppelius in BRB's Coppelia. While soloist James Barton gives energy and oafishness to Alain.
The charming romance and coquettish dances between the leads take us through the first two acts which conclude with an action-packed storm that ramps the drama up to another level.
The final act carries on with the humour but also some of the most enchanting moments between the lovers, danced beautifully by Momoko Hirata and Mathias Dingman. Dingman is perfect for the role, playing it with full-on cheekiness and charm. Together the pair are a treat.
This ballet may have been performed several times over the years by BRB but it never loses its charm. It's a timeless classic that is a joy. You can't help but fall in love with it.