Digitall.Testing
1.0.0-beta.13
dotnet add package Digitall.Testing --version 1.0.0-beta.13
NuGet\Install-Package Digitall.Testing -Version 1.0.0-beta.13
<PackageReference Include="Digitall.Testing" Version="1.0.0-beta.13" />
<PackageVersion Include="Digitall.Testing" Version="1.0.0-beta.13" />
<PackageReference Include="Digitall.Testing" />
paket add Digitall.Testing --version 1.0.0-beta.13
#r "nuget: Digitall.Testing, 1.0.0-beta.13"
#:package Digitall.Testing@1.0.0-beta.13
#addin nuget:?package=Digitall.Testing&version=1.0.0-beta.13&prerelease
#tool nuget:?package=Digitall.Testing&version=1.0.0-beta.13&prerelease
DigitallStub
A .NET stub implementation for Microsoft Dataverse testing, providing a lightweight, in-memory IOrganizationService.
Features
- FakeOrganizationService: In-memory implementation of
IOrganizationService. - Query Support: Supports
QueryExpression,QueryByAttribute, andFetchXml. - Request Fakes: Extensible architecture for mocking
OrganizationRequestmessages. - Early-Bound Support: Automatically discovers early-bound entity types via
[assembly:ProxyTypesAssembly]. - Plugin Testing: Utilities for building and testing Dataverse plugins (e.g.,
PluginExecutionContextBuilder).
Prerequisites
- .NET SDK: Supports
net462andnet10.0. - IDE: Rider or Visual Studio.
Setup & Build
- Restore Dependencies:
dotnet restore - Build Solution:
dotnet build
Usage
Basic Example
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Query;
using AwesomeAssertions;
using Digitall.Testing;
[TestClass]
public class DataverseStubTests
{
[TestMethod]
public void Should_CreateAndRetrieveEntity()
{
// Arrange: Initialize the fake service
var service = new FakeOrganizationService();
var account = new Entity("account")
{
["name"] = "Test Account"
};
// Act: Perform operations
var id = service.Create(account);
var retrieved = service.Retrieve("account", id, new ColumnSet("name"));
// Assert: Verify results
retrieved.Should().NotBeNull();
retrieved["name"].Should().Be("Test Account");
}
}
Early-Bound Entities
To use early-bound types, ensure your test assembly (or the assembly containing the types) has the ProxyTypesAssembly attribute:
[assembly: Microsoft.Xrm.Sdk.Client.ProxyTypesAssembly]
Testing
Tests are located in tests/Digitall.Testing.Tests.
- Run all tests:
dotnet test - Run specific tests:
dotnet test --filter Name~YourTestName
Configuration (Environment Variables)
The FakeOrganizationService and its internal components can be influenced by the following environment variables:
| Variable | Description | Default |
|---|---|---|
MaxRetrieveCount |
Maximum number of records returned by RetrieveMultiple. |
5000 |
UserId |
The ID of the current user (used in WhoAmI and EqualUserId filters). |
Guid.Empty |
BusinessUnitId |
The ID of the current business unit. | Guid.Empty |
FiscalYearStart |
Start date for fiscal year calculations. | Current Year Start |
Project Structure
src/Digitall.Testing: Core library containingFakeOrganizationService.Extensions: Utilities for Entities, QueryExpressions, etc.OrganizationRequests: Custom fakes for specificOrganizationRequesttypes.Logic: Internal logic for query processing and state management.
tests/Digitall.Testing.Tests: Unit tests for the library.
License
This project is licensed under the Microsoft Public License (MS-PL). See Licence.md for details.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Framework | net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
-
.NETFramework 4.6.2
- DeepCloner (>= 0.10.4)
- Microsoft.Extensions.TimeProvider.Testing (>= 10.5.0)
- Microsoft.PowerPlatform.Dataverse.Client (>= 1.2.10)
- NSubstitute (>= 5.3.0)
-
net10.0
- DeepCloner (>= 0.10.4)
- Microsoft.Extensions.TimeProvider.Testing (>= 10.5.0)
- Microsoft.PowerPlatform.Dataverse.Client (>= 1.2.10)
- NSubstitute (>= 5.3.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0-beta.13 | 53 | 4/29/2026 |
| 1.0.0-beta.12 | 142 | 3/11/2026 |
| 1.0.0-beta.11 | 55 | 3/11/2026 |
| 1.0.0-beta.10 | 55 | 3/11/2026 |
| 1.0.0-beta.9 | 46 | 3/10/2026 |
| 1.0.0-beta.8 | 55 | 3/10/2026 |
| 1.0.0-beta.6 | 234 | 12/19/2025 |
| 1.0.0-beta.5 | 224 | 5/27/2025 |
| 1.0.0-beta.4 | 128 | 4/25/2025 |
| 1.0.0-beta.3 | 169 | 4/24/2025 |
| 1.0.0-beta.2 | 144 | 4/22/2025 |
| 1.0.0-beta.1 | 213 | 4/17/2025 |