# DataSourceContext data type
> Version: _Available or changed with runtime version 18.0._
Represents the context passed to a data source codeunit that implements the ITestDataSource interface.
## Instance methods
The following methods are available on instances of the DataSourceContext data type.
Method name|Description
datasourcecontext-appid-method|Gets the ID of the app in which the test function is defined.
datasourcecontext-codeunitid-method|Gets the ID of the codeunit that is providing the test data for the current test case.
## Related information
Getting started with AL<../../devenv-get-started>
Developing extensions<../../devenv-dev-overview>
Test codeunits and test methods in AL<../../devenv-test-codeunits-and-test-methods>
../../attributes/devenv-testdatasource-attribute
../testhandlercontext/testhandlercontext-data-type

Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/datasourcecontext/datasourcecontext-data-type, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact. https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/datasourcecontext/datasourcecontext-data-type/
