From d5d510dd891e0a209b09b29557851c3f1ee3f94a Mon Sep 17 00:00:00 2001 From: KevinMarquette Date: Sun, 5 Feb 2017 01:06:38 -0800 Subject: [PATCH] Added unit test for format command --- Tests/Unit.Tests.ps1 | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/Tests/Unit.Tests.ps1 b/Tests/Unit.Tests.ps1 index ece0505..3f91f90 100644 --- a/Tests/Unit.Tests.ps1 +++ b/Tests/Unit.Tests.ps1 @@ -19,6 +19,18 @@ Describe "Basic unit tests" -Tags Build { } } + Context "Function: Format-Chronometer" { + + it "Does not throw" { + {$null | Format-Chronometer } | Should Not Throw + } + + it "Can process a result object without throwing" { + $results = Get-Chronometer -Path $PSScriptRoot\..\ScratchFiles\example.ps1 -Script {. "$PSScriptRoot\..\ScratchFiles\example.ps1"} + $results | Format-Chronometer *>&1 | Should Not BeNullOrEmpty + } + } + InModuleScope $moduleName { Context "Class: ScriptLine" { @@ -44,11 +56,15 @@ Describe "Basic unit tests" -Tags Build { } Context "Class: MonitoredScript" { - {[MonitoredScript]::New()} | Should Not Throw + it "Creates an object" { + {[MonitoredScript]::New()} | Should Not Throw + } + + it "SetScript()" { + $monitor = [MonitoredScript]::New() + {$monitor.SetScript("$projectRoot\scratchfiles\example.ps1")} | Should Not Throw + } } - Context "Class: MonitoredScript" { - {[MonitoredScript]::SetScript("$projectRoot\scratchfiles\example.ps1")} | Should Not Throw - } } } \ No newline at end of file