Skip to content
This repository was archived by the owner on May 30, 2019. It is now read-only.

Commit ff76677

Browse files
committed
Adding first set of Pester tests for the project. These tests cover importing the configuration file.
1 parent 0c15eb9 commit ff76677

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

Functions/Internal.Tests.ps1

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
$here = Split-Path -Parent $MyInvocation.MyCommand.Path
2+
$toplevel = Split-Path -Parent $here
3+
$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".")
4+
5+
. "$here\$sut"
6+
7+
Describe "Importing of XML Configuration File" {
8+
Context "Loading a Configuration File" {
9+
$Config = Import-XMLConfig -ConfigPath "$toplevel/StatsToGraphiteConfig.xml"
10+
11+
It "Loaded Configuration File Should Not Be Empty" {
12+
$Config | Should Not BeNullOrEmpty
13+
}
14+
It "Should Have 15 Properties" {
15+
$Config.Count | Should Be 15
16+
}
17+
It "SendUsingUDP should be Boolean" {
18+
$Config.SendUsingUDP -is [Boolean] | Should Be $true
19+
}
20+
It "MSSQLMetricSendIntervalSeconds should be Int32" {
21+
$Config.MSSQLMetricSendIntervalSeconds -is [Int32] | Should Be $true
22+
}
23+
It "MSSQLConnectTimeout should be Int32" {
24+
$Config.MSSQLConnectTimeout -is [Int32] | Should Be $true
25+
}
26+
It "MSSQLQueryTimeout should be Int32" {
27+
$Config.MSSQLQueryTimeout -is [Int32] | Should Be $true
28+
}
29+
It "MetricSendIntervalSeconds should be Int32" {
30+
$Config.MetricSendIntervalSeconds -is [Int32] | Should Be $true
31+
}
32+
It "MetricTimeSpan should be TimeSpan" {
33+
$Config.MetricTimeSpan -is [TimeSpan] | Should Be $true
34+
}
35+
It "MSSQLMetricTimeSpan should be TimeSpan" {
36+
$Config.MSSQLMetricTimeSpan -is [TimeSpan] | Should Be $true
37+
}
38+
}
39+
}

0 commit comments

Comments
 (0)