You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$NewGroupRule=Initialize-OktaGroupRule-Actions $GroupRuleAction-Conditions $GroupRuleConditions-Name "Assign users to the Sales Team"-Type "group_rule"
101
+
102
+
$CleanedRule=Remove-NullProperties$NewGroupRule
103
+
104
+
$CleanedRule.name| Should -Be "Assign users to the Sales Team"
105
+
$CleanedRule.type| Should -Be "group_rule"
106
+
$CleanedRule.actions.assignUserToGroups.groupIds.Count| Should -Be 1
107
+
$CleanedRule.actions.assignUserToGroups.groupIds[0] | Should -Be "foo"
108
+
}
109
+
110
+
It 'Should maintain the same object when there''s no null values in a multiple-items array when using initializers'{
$NewGroupRule=Initialize-OktaGroupRule-Actions $GroupRuleAction-Conditions $GroupRuleConditions-Name "Assign users to the Sales Team"-Type "group_rule"
121
+
122
+
$CleanedRule=Remove-NullProperties$NewGroupRule
123
+
124
+
$CleanedRule.name| Should -Be "Assign users to the Sales Team"
125
+
$CleanedRule.type| Should -Be "group_rule"
126
+
$CleanedRule.actions.assignUserToGroups.groupIds.Count| Should -Be 1
127
+
$CleanedRule.actions.assignUserToGroups.groupIds[0] | Should -Be "foo"
$NewGroupRule=Initialize-OktaGroupRule-Actions $GroupRuleAction-Conditions $GroupRuleConditions-Name "Assign users to the Sales Team"-Type "group_rule"
139
+
140
+
$CleanedRule=Remove-NullProperties$NewGroupRule
141
+
142
+
$CleanedRule.name| Should -Be "Assign users to the Sales Team"
143
+
$CleanedRule.type| Should -Be "group_rule"
144
+
$CleanedRule.actions.assignUserToGroups.groupIds.Count| Should -Be 3
145
+
$CleanedRule.actions.assignUserToGroups.groupIds[0] | Should -Be "foo"
146
+
$CleanedRule.actions.assignUserToGroups.groupIds[1] | Should -Be "bar"
147
+
$CleanedRule.actions.assignUserToGroups.groupIds[2] | Should -Be "baz"
0 commit comments