Dependencies/Axiom/Verify-Same.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
function Verify-Same {
    param (
        [Parameter(ValueFromPipeline=$true)]
        $Actual,
        [Parameter(Mandatory=$true,Position=0)]
        $Expected
    )

    if (-not [object]::ReferenceEquals($Expected, $Actual)) {
        throw [Exception]"Expected the objects to be the same instance but they were not."
    }

    $Actual
}