---
title: "Codeunit 132927 MockGraphQuery Test Library"
author: "JOP-AL"
url: https://jonas-paprotka.de/ref/codeunit/132927-mockgraphquery-test-library/
type: codeunit
id: 132927
name: "MockGraphQuery Test Library"
app: "System Application Test Library"
namespace: System.TestLibraries.Mocking
versions: "21-29"
build: 29.0.54011.55644
countries: "W1, DE, US"
source: "https://jonas-paprotka.de/ref/codeunit/132927-mockgraphquery-test-library/source/?v=24 https://jonas-paprotka.de/ref/codeunit/132927-mockgraphquery-test-library/source/?v=25 https://jonas-paprotka.de/ref/codeunit/132927-mockgraphquery-test-library/source/?v=26 https://jonas-paprotka.de/ref/codeunit/132927-mockgraphquery-test-library/source/?v=27 https://jonas-paprotka.de/ref/codeunit/132927-mockgraphquery-test-library/source/?v=28 https://jonas-paprotka.de/ref/codeunit/132927-mockgraphquery-test-library/source/"
checked: 2026-11-20
changed: 2026-10-05
subject: "Microsoft Dynamics 365 Business Central"
license: "Metadata from Microsoft's symbol packages. AL source MIT, Copyright (c) Microsoft Corporation. Selection and wording © 2026 JOP-AL. https://jonas-paprotka.de/licenses/"
---

# Codeunit 132927 MockGraphQuery Test Library

JOP-AL, https://jonas-paprotka.de/ref/codeunit/132927-mockgraphquery-test-library/

| | |
| --- | --- |
| App | System Application Test Library |
| Namespace | System.TestLibraries.Mocking |
| Versions | 21-29 |
| Minors | W1 21.0-29.0; DE 21.0-29.0; US 21.0-29.0, [every minor](https://jonas-paprotka.de/ref/codeunit/132927-mockgraphquery-test-library/editions.json) |
| Source file | MockGraphQuery/src/MockGraphQueryTestLibrary.Codeunit.al |

## Procedures

| Name | Parameters | Returns | Access | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- | --- |
| GetMockGraphQuery | (MockGraphQueryOut: DotNet MockGraphQuery) | - | public | 21-29 | - | - |
| SetupMockGraphQuery | () | - | public | 21-29 | - | - |
| CreateAzureADUser | (var UserInfo: DotNet UserInfo; UserSecurityId: Guid; ObjectId: Text; Surname: Text; DisplayName: Text; Email: Text; PrincipalName: Text; GivenName: Text; PreferredLanguage: Text; AccountEnabled: Boolean) | - | public | 21-29 | - | - |
| SetCurrentUser | (UserInfo: DotNet UserInfo) | - | public | 21-29 | - | - |
| CreateUserInfo | (var UserInfo: DotNet UserInfo; ObjectId: Text; Surname: Text; DisplayName: Text; Email: Text; PrincipalName: Text; GivenName: Text; PreferredLanguage: Text; AccountEnabled: Boolean) | - | public | 21-29 | - | - |
| InsertUser | (var User: Record User; UserSecurityId: Guid; Enabled: Boolean; FullName: Text; ContactEmail: Text; AuthenticationEmail: Text; UserName: Text) | - | public | 21-29 | - | - |
| SetCurrentUser | (UserGivenName: Text; UserEmail: Text) | - | public | 21-29 | - | - |
| AddGraphUser | (UserId: Text; UserGivenName: Text; UserSurname: Text; UserEmail: Text) | - | public | 21-29 | - | - |
| AddGraphUser | (UserId: Text; UserGivenName: Text; UserSurname: Text; UserEmail: Text; AccountEnabled: Boolean) | - | public | 21-29 | - | - |
| AddAndReturnGraphUser | (var GraphUserInfo: DotNet UserInfo; UserId: Text; UserGivenName: Text; UserSurname: Text; UserEmail: Text) | - | public | 21-29 | - | - |
| AddUserPlan | (UserId: Text; AssignedPlanId: Guid; AssignedPlanService: Text; CapabilityStatus: Text) | - | public | 21-29 | - | - |
| AddDirectoryRole | (var DirectoryRole: DotNet RoleInfo; RoleTemplateId: Text; RoleDescription: Text; RoleDisplayName: Text; RoleIsSystem: Boolean) | - | public | 21-29 | - | - |
| AddUserRole | (UserId: Text; RoleTemplateId: Text; RoleDescription: Text; RoleDisplayName: Text; RoleIsSystem: Boolean) | - | public | 21-29 | - | - |
| AddSubscribedSkuWithServicePlan | (SkuId: Guid; PlanId: Guid; PlanName: Text) | - | public | 21-29 | - | - |
| AddDirectorySubscribedSku | (SkuInfo: DotNet SkuInfo) | - | public | 21-29 | - | - |
| GetDirectorySubscribedSkus | (DirectorySubscribedSkus: DotNet GenericList1) | - | public | 21-29 | - | - |
| PopulateMockGraph | (GraphUserInfo: DotNet UserInfo; PlanId: Guid; PlanName: Text) | - | public | 21-29 | - | - |
| AddGraphUser | (UserId: Text; UserGivenName: Text; UserSurname: Text; UserEmail: Text; AssignedPlanId: Guid; AssignedPlanService: Text; CapabilityStatus: Text) | - | public | 21-29 | - | - |
| AddGraphUser | (var GraphUser: DotNet UserInfo; UserId: Text; UserGivenName: Text; UserSurname: Text; UserEmail: Text; AssignedPlanId: Guid; AssignedPlanService: Text; CapabilityStatus: Text) | - | public | 21-29 | - | - |
| CreateGraphUser | (var GraphUserInfo: DotNet UserInfo; UserId: Text; UserGivenName: Text; UserSurname: Text; UserEmail: Text) | - | public | 21-29 | - | - |
| CreateGraphUser | (var GraphUserInfo: DotNet UserInfo; UserId: Text; UserGivenName: Text; UserSurname: Text; UserEmail: Text; AccountEnabled: Boolean) | - | public | 21-29 | - | - |
| AddGraphUserWithoutPlan | (UserId: Text; UserGivenName: Text; UserSurname: Text; UserEmail: Text) | - | public | 21-29 | - | - |
| AddGraphUserWithInDevicesGroup | (UserId: Text; UserGivenName: Text; UserSurname: Text; UserEmail: Text) | - | public | 21-29 | - | - |
| AddGraphUserToDevicesGroup | (GraphUser: DotNet UserInfo) | - | public | 21-29 | - | - |
| AddGraphUserToGroup | (GraphUser: DotNet UserInfo; GroupName: Text) | - | public | 21-29 | - | - |
| SetM365CollaborationEnabled | (M365CollaborationEnabled: Boolean) | - | public | 21-29 | - | - |
| GetM365CollaborationEnabled | () | Boolean | public | 21-29 | - | - |
| SetEnvironmentDirectoryGroup | (EnvironmentDirectoryGroup: Text) | - | public | 21-29 | - | - |
| GetEnvironmentDirectoryGroup | () | Text | public | 21-29 | - | - |
| AddGraphUserToGroup | (GraphUser: DotNet UserInfo; GroupName: Text; GroupId: Text) | - | public | 22-29 | - | - |
| AddGroup | (GroupName: Text; GroupId: Text) | - | public | 22-29 | - | - |

## Source

Symbols: Microsoft.SystemApplicationTestLibrary.symbols.9856ae4f-d1a7-46ef-89bb-6ef056398228, https://dynamicssmb2.pkgs.visualstudio.com/DynamicsBCPublicFeeds/_packaging/MSSymbols/nuget/v3/index.json, highest build per major on 2026-11-20.
AL source 24: https://github.com/microsoft/BCApps, MIT, releases/24.x at fe14d3e6db00d28df3a69c7bba830813d70794e2.
AL source 25: https://github.com/microsoft/BCApps, MIT, releases/25.x at 68d52c129129c83b2e396a473aaa5b2ce61d2eed.
AL source 26: https://github.com/microsoft/BCApps, MIT, releases/26.x at 8fd089973d4be7f6224d0845f41bec221fdda7dc.
AL source 27: https://github.com/microsoft/BCApps, MIT, releases/27.x at ad459712441b2fe6cb0cf1c560563f8ec7188a93.
AL source 28: https://github.com/microsoft/BCApps, MIT, releases/28.x at 408a4cc8d3a4c54b60464cc14c964479facb9ba0.
AL source 29: https://github.com/microsoft/BCApps, MIT, releases/29.x at 4303e5e584d3aa5d9e98cbc615525a5396ad6ed7.

JOP-AL, 2026-11-20.
