From b302bf0937176ee107a502bf1252e5984e449442 Mon Sep 17 00:00:00 2001 From: John D Pell Date: Thu, 20 May 2021 02:17:29 -0400 Subject: [PATCH] ADGroup: Test SamAccountName parameter --- tests/Unit/MSFT_ADGroup.Tests.ps1 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/Unit/MSFT_ADGroup.Tests.ps1 b/tests/Unit/MSFT_ADGroup.Tests.ps1 index 0ffe8192..a9c6bba7 100644 --- a/tests/Unit/MSFT_ADGroup.Tests.ps1 +++ b/tests/Unit/MSFT_ADGroup.Tests.ps1 @@ -43,6 +43,7 @@ try Path = 'OU=OU,DC=contoso,DC=com' Description = 'Test AD group description' DisplayName = 'Test display name' + SamAccountName = 'TestGroup' Ensure = 'Present' Notes = 'This is a test AD group' ManagedBy = 'CN=User 1,CN=Users,DC=contoso,DC=com' @@ -91,6 +92,7 @@ try Path = $mockGroupPath Description = 'Test AD group description' DisplayName = 'Test display name' + SamAccountName = $mockGroupName Info = 'This is a test AD group' ManagedBy = 'CN=User 1,CN=Users,DC=contoso,DC=com' DistinguishedName = "CN=$mockGroupName,$mockGroupPath" @@ -101,6 +103,7 @@ try GroupScope = 'Universal' Description = 'Test AD group description changed' DisplayName = 'Test display name changed' + SamAccountName = 'TestGroup2' ManagedBy = 'CN=User 2,CN=Users,DC=contoso,DC=com' } @@ -111,6 +114,7 @@ try Path = $mockADGroup.Path Description = $mockADGroup.Description DisplayName = $mockADGroup.DisplayName + SamAccountName = $mockAdGroup.SamAccountName Notes = $mockADGroup.Info ManagedBy = $mockADGroup.ManagedBy DistinguishedName = $mockADGroup.DistinguishedName @@ -125,6 +129,7 @@ try Path = $null Description = $null DisplayName = $null + SamAccountName = $null Notes = $null ManagedBy = $null DistinguishedName = $null @@ -162,6 +167,7 @@ try $result.Path | Should -Be $mockADGroup.Path $result.Description | Should -Be $mockADGroup.Description $result.DisplayName | Should -Be $mockADGroup.DisplayName + $result.SamAccountName | Should -Be $mockADGroup.SamAccountName $result.MembersToInclude | Should -BeNullOrEmpty $result.MembersToExclude | Should -BeNullOrEmpty $result.MembershipAttribute | Should -Be 'SamAccountName' @@ -338,6 +344,7 @@ try $result.Path | Should -BeNullOrEmpty $result.Description | Should -BeNullOrEmpty $result.DisplayName | Should -BeNullOrEmpty + $result.SamAccountName | Should -BeNullOrEmpty $result.Members | Should -BeNullOrEmpty $result.MembersToInclude | Should -BeNullOrEmpty $result.MembersToExclude | Should -BeNullOrEmpty @@ -369,6 +376,7 @@ try Path = $mockADGroup.Path Description = $mockADGroup.Description DisplayName = $mockADGroup.DisplayName + SamAccountName = $mockADGroup.SamAccountName ManagedBy = $mockADGroup.ManagedBy Notes = $mockADGroup.Info Members = $mockADGroup.Members @@ -552,6 +560,7 @@ try Path = $mockADGroup.Path Description = $mockADGroup.Description DisplayName = $mockADGroup.DisplayName + SamAccountName = $mockADGroup.SamAccountName ManagedBy = $mockADGroup.ManagedBy Notes = $mockADGroup.Info Members = $mockADGroup.Members