Skip to content

Commit fc79763

Browse files
committed
Refactor UserMetadataUpdater tests, optimize batch logic
- Split UserMetadataUpdater tests into focused files: Basic, Insert, License, Manager, and Metadata, improving organization and maintainability. - Added UserMetadataUpdaterMetadataTests covering metadata enrichment, nullification, whitespace trimming, and lookup entity reuse. - Improved batching performance in user/manager/license processing by replacing .Skip().Take() with .GetRange(). - Optimized manager resolution with O(1) AAD ID lookups and ensured tracked entities are used to prevent duplicate key errors. - Enhanced handling of null/cleared metadata fields and duplicate UPNs. - Updated .csproj to include new test files and removed old test region from UserImportTests.cs.
1 parent 3485bd2 commit fc79763

File tree

11 files changed

+1964
-2755
lines changed

11 files changed

+1964
-2755
lines changed

src/AnalyticsEngine/Tests.UnitTests/Tests.UnitTests.csproj

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\WebApplications\Microsoft.WebApplication.targets" />
44
<PropertyGroup>
@@ -30,6 +30,11 @@
3030
</Target>
3131
<ItemGroup>
3232
<Compile Remove="Generated\**" />
33+
<Compile Include="UserMetadataUpdaterBasicTests.cs" />
34+
<Compile Include="UserMetadataUpdaterInsertTests.cs" />
35+
<Compile Include="UserMetadataUpdaterLicenseTests.cs" />
36+
<Compile Include="UserMetadataUpdaterManagerTests.cs" />
37+
<Compile Include="UserMetadataUpdaterMetadataTests.cs" />
3338
<Content Include="Generated\**" />
3439
</ItemGroup>
3540
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">

0 commit comments

Comments
 (0)