Skip to content

IsNull() throws NotSupportedException in in-memory fake event store #17

@LarsSkovslund

Description

@LarsSkovslund

Summary

When using the in-memory Chronicles fake (e.g., via AddFakeChronicles in test projects),
queries that use the IsNull() extension method throw NotSupportedException at runtime.
The same queries work correctly against a real Cosmos DB instance.

Repro

Register Chronicles with the in-memory fake in a test host:

services.AddFakeChronicles(b => b
    .WithEventStore(e => e.AddSessionEvents()));

Then execute any query that uses IsNull()for example, filtering on a nullable field:

var sessions = await documentReader.GetDocumentsAsync(
    d => d.Where(s => s.EndedAt.IsNull()));

Result: System.NotSupportedException is thrown.
Expected: Query returns matching documents from the in-memory store.

Context

Discovered while wiring AddFakeChronicles into an ASP.NET Core WebApplicationFactory for integration testing. Queries that rely
on IsNull() (e.g., listing active/open sessions by filtering where EndedAt is null) cannot be tested in-memory due to this gap.

Workaround: stub the affected query methods in a fake implementation. This disconnects the test from the real query logic and
reduces confidence in integration tests.

Environment

- Chronicles version: (please fill in from your NuGet reference)
- .NET 10
- Test host: Microsoft.AspNetCore.Mvc.Testing + Alba

Expected Behaviour

The in-memory fake should support IsNull() so that integration tests can exercise the full query path without requiring a real
Cosmos DB connection.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions