Tests/MipSdkRedist.VideoOS.Tests.ps1

Describe 'MIP SDK Environment Tests' {
    BeforeAll {
        $ModuleManifestName = 'MipSdkRedist.psd1'
        $script:ModuleManifestPath = "$PSScriptRoot\..\$ModuleManifestName"
    }

    It 'Loads MIP SDK in less than 1 seconds' {
        $stopwatch = [diagnostics.stopwatch]::StartNew()
        Import-Module $script:ModuleManifestPath
        $stopwatch.Elapsed.TotalSeconds | Should -BeLessThan 1
    }

    It 'MIP SDK Configuration is not null' {
        [videoos.platform.configuration]::Instance | Should -Not -BeNullOrEmpty
    }

    It 'Resolves all Newtonsoft.Json assembly versions to 12' {
        $assemblyName = "Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed"
        $typeName = "Newtonsoft.Json.JsonSerializer"
        $serializer = [appdomain]::CurrentDomain.CreateInstanceAndUnwrap($assemblyName, $typeName)
        $serializer.GetType().Assembly.FullName | Should -Be 'Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'
    }
}