1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//! Testing utilities for InferaDB SDK.
//!
//! This module provides tools for testing applications that use the SDK:
//!
//! - [`MockClient`]: A mock client with expectation verification
//! - [`InMemoryClient`]: An in-memory client with real graph semantics
//! - [`AuthorizationClient`]: Object-safe trait for dependency injection
//!
//! ## Quick Start
//!
//! ```rust
//! use inferadb::testing::{MockClient, AuthorizationClient};
//!
//! // Create a mock client
//! let mock = MockClient::new()
//! .expect_check("user:alice", "view", "doc:1", true);
//!
//! // Use the mock in tests
//! async fn test_with_mock(client: &dyn AuthorizationClient) {
//! let allowed = client.check("user:alice", "view", "doc:1").await.unwrap();
//! assert!(allowed);
//! }
//! ```
//!
//! ## MockClient vs InMemoryClient
//!
//! | Feature | MockClient | InMemoryClient |
//! |---------|------------|----------------|
//! | Expectation verification | ✓ | ✗ |
//! | Graph traversal | ✗ | ✓ |
//! | Schema validation | ✗ | ✓ |
//! | Relationship storage | ✗ | ✓ |
//! | Best for | Unit tests | Integration tests |
pub use AuthorizationClient;
pub use InMemoryClient;
pub use MockClient;
pub use ;