Skip to content
This repository has been archived by the owner on May 15, 2018. It is now read-only.

Commit

Permalink
Describing Get-DscLatestJobId
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtWDrahn committed Nov 10, 2014
1 parent 485adc8 commit 52ac1fb
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion Tooling/cDscDiagnostics/cDscDiagnostics.psm1.Tests.ps1
Expand Up @@ -72,7 +72,7 @@ InModuleScope cDscDiagnostics {
Context 'SequenceID is passed' {
Mock -ModuleName cDscDiagnostics Log { }
$result = Trace-DscOperationInternal -SequenceID 0;

It 'should return null if SequenceID is less then 1' {
$result | Should Be $null;
}
Expand Down Expand Up @@ -188,6 +188,38 @@ InModuleScope cDscDiagnostics {
Clear-DscDiagnosticsCache
}
}

Describe 'Get-DscLatestJobId' {
Context 'It has a Job to Return' {
Mock -ModuleName cDscDiagnostics Get-WinEvent {
$value = @{"Value" = "{3BBB79B7-BD46-424C-9718-983C8C76D37E}"}
$returnObject = @(@{Properties = @($value)}, [Environment]::NewLine)
return @(@{Properties = @($value)}, [Environment]::NewLine)
}

$result = Get-DscLatestJobId;

It 'should return the GUID' {
$result | Should Be "{3BBB79B7-BD46-424C-9718-983C8C76D37E}"
}
}

Context 'When it does not have a Job' {
Mock -ModuleName cDscDiagnostics Get-WinEvent {
return $null
}

$result = Get-DscLatestJobId;

It 'should return "NOJOBID"' {
$result | Should Be "NOJOBID"
}
}

AfterEach {
Clear-DscDiagnosticsCache
}
}
}

Describe "Get-cDscOperation" {
Expand Down

0 comments on commit 52ac1fb

Please sign in to comment.