-
Notifications
You must be signed in to change notification settings - Fork 0
API Reference
Aryeh Citron edited this page May 12, 2026
·
3 revisions
Static class for creating in-memory BigQuery instances.
| Method | Description |
|---|---|
Create(projectId, datasetId?, configureDataset?) |
Creates a simple instance with optional dataset |
Builder() |
Returns a builder for complex configurations |
Fluent builder for multi-dataset setups.
| Method | Description |
|---|---|
WithProjectId(string) |
Sets the GCP project ID |
AddDataset(string, Action<InMemoryDatasetBuilder>?) |
Adds a dataset |
WithFaultInjector(Func<...>?) |
Sets the fault injector |
Build() |
Builds and returns the result |
Result of creating an in-memory instance. Implements IDisposable.
| Property | Tier | Description |
|---|---|---|
Client |
1 — Production-like | Real BigQueryClient backed by in-memory store |
Store |
2 — Test setup | Direct access to InMemoryDataStore
|
Handler |
3 — Diagnostics | The FakeBigQueryHandler (logs, fault injection) |
| Method | Description |
|---|---|
SetFaultInjector(Func<...>?) |
Sets or clears fault injection |
CreateReadClient() |
Creates a BigQueryReadClient backed by the same in-memory store (Storage Read API) |
Dispose() |
Cleans up resources |
| Property | Description |
|---|---|
ProjectId |
The GCP project ID |
Datasets |
ConcurrentDictionary<string, InMemoryDataset> |
JsUdfEngine |
Optional IJsUdfEngine for JavaScript UDF execution |
| Method | Description |
|---|---|
ExportState() |
Returns JSON string of all datasets, tables, and rows |
ExportStateToFile(string path) |
Exports state directly to a file |
ImportState(string json) |
Replaces all data from a JSON string |
ImportStateFromFile(string path) |
Imports state directly from a file |
UseJsUdfs() |
Registers the Jint JavaScript engine for LANGUAGE js UDFs (requires InMemoryEmulator.BigQuery.JsUdfs package) |
| Property | Description |
|---|---|
DatasetId |
Dataset identifier |
Tables |
ConcurrentDictionary<string, InMemoryTable> |
Description, FriendlyName, Location, Labels
|
Metadata |
CreationTime, LastModifiedTime, Etag
|
Timestamps |
| Property | Description |
|---|---|
TableId |
Table identifier |
Schema |
TableSchema — the column definitions |
RowCount |
Number of rows |
Description, FriendlyName, Labels
|
Metadata |
CreationTime, LastModifiedTime, Etag
|
Timestamps |
Extends HttpMessageHandler. Routes BigQuery REST API calls to the in-memory store.
| Property | Description |
|---|---|
FaultInjector |
Optional delegate for simulating errors |
RequestLog |
ConcurrentBag<string> of all requests |
QueryLog |
ConcurrentBag<string> of all SQL queries |
Implements IHttpClientFactory for the Google API client pipeline.
| Method | Description |
|---|---|
UseInMemoryBigQuery(Action<InMemoryBigQueryOptions>?) |
Replaces BigQueryClient with in-memory |
| Property | Description |
|---|---|
ProjectId |
GCP project ID (default: "test-project") |
Datasets |
List of datasets to create |
OnClientCreated |
Callback after the client is created |
Getting Started
Integration & DI
Data Management
Reference