Path: redb/redb.Tests.Integration/Models/HashCanonProbeModels.cs
Snapshot: redb, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb
Page: https://redbase.app/src/dev-2026-12-06/redb/redb.Tests.Integration/Models/HashCanonProbeModels.cs
----
using System;
using System.Collections.Generic;
using redb.Core.Attributes;
namespace redb.Tests.Integration.Models;
///
/// Probe scheme for the hash canon collisions: values whose canon strings would coincide if the canon did not escape
/// its separators. Synced by the tests that use it, not by the fixtures.
///
[RedbScheme(Name = "HashCanonProbe")]
public class HashCanonProbeProps
{
public string? A { get; set; }
public string? B { get; set; }
public string? Label { get; set; }
public List? Tags { get; set; }
public Dictionary? Dict { get; set; }
public HashCanonPair? Inner { get; set; }
public List? Items { get; set; }
}
/// A class value with two strings: a nested class and an element of a class collection.
public class HashCanonPair
{
public string? A { get; set; }
public string? B { get; set; }
}
///
/// A dictionary key class with value equality and no ToString of its own: its ToString is the type name for every
/// key.
///
public class HashCanonKey : IEquatable
{
public string? Code { get; set; }
public int Rank { get; set; }
public bool Equals(HashCanonKey? other) => other is not null && Code == other.Code && Rank == other.Rank;
public override bool Equals(object? obj) => Equals(obj as HashCanonKey);
public override int GetHashCode() => HashCode.Combine(Code, Rank);
}
/// Probe scheme with a dictionary keyed by a class.
[RedbScheme(Name = "HashCanonClassKeyProbe")]
public class HashCanonClassKeyProps
{
public string? Label { get; set; }
public Dictionary? ByKey { get; set; }
}
/// Probe scheme with a dictionary keyed by a value tuple of culture-sensitive members.
[RedbScheme(Name = "HashCanonTupleKeyProbe")]
public class HashCanonTupleKeyProps
{
public string? Label { get; set; }
public Dictionary<(double Rate, DateTime At), string>? ByTuple { get; set; }
}