@@ -11,6 +11,8 @@ namespace Microsoft.Graph.Bicep.Types.UnitTests
1111 [ TestClass ]
1212 public class MicrosoftGraphTypeLoaderTests
1313 {
14+ private string keyPropertyName = "uniqueName" ;
15+
1416 private IReadOnlySet < string > availableTypes = new HashSet < string >
1517 {
1618 "Microsoft.Graph/applications@beta" ,
@@ -20,7 +22,7 @@ public class MicrosoftGraphTypeLoaderTests
2022 "Microsoft.Graph/oauth2PermissionGrants@beta" ,
2123 } ;
2224
23- private IReadOnlySet < string > typesWithRequiredName = new HashSet < string >
25+ private IReadOnlySet < string > typesWithRequiredKey = new HashSet < string >
2426 {
2527 "Microsoft.Graph/applications@beta" ,
2628 "Microsoft.Graph/groups@beta" ,
@@ -79,9 +81,11 @@ public void MSGraphTypeLoader_can_load_resources_and_properties()
7981 properties . Should ( ) . NotBeNull ( ) ;
8082 properties . Should ( ) . HaveCountGreaterThan ( 4 ) ; // Should at least have id, name, type, and apiVersion
8183
82- // Check "name" has correct flags
83- var nameFlags = typesWithRequiredName . Contains ( kvp . Key ) ? ObjectTypePropertyFlags . Required | ObjectTypePropertyFlags . DeployTimeConstant : ObjectTypePropertyFlags . None ;
84- properties [ "name" ] . Flags . Should ( ) . HaveFlag ( nameFlags ) ;
84+ // Check "uniqueName" has correct flags
85+ if ( typesWithRequiredKey . Contains ( kvp . Key ) )
86+ {
87+ properties [ keyPropertyName ] . Flags . Should ( ) . HaveFlag ( ObjectTypePropertyFlags . Required | ObjectTypePropertyFlags . DeployTimeConstant ) ;
88+ }
8589
8690 // Check directory objects have "id" and "deletedDateTime" properties
8791 if ( directoryObjects . Contains ( kvp . Key ) )
0 commit comments