- Move login and refresh endpoints under a unified /auth route group
- Relocate institution connection logic from /accounts to /institutions
- Implement GET /institutions/{id}/available to fetch real-time Plaid
accounts
- Introduce HttpRequestBuilder utility to streamline integration testing
- Enhance PlaidService with GetAccountsAsync to support account fetching
- Clean up global usings and project structure for better domain
isolation
41 lines
1.1 KiB
C#
41 lines
1.1 KiB
C#
namespace FiscalOS.API.Tests.Infra;
|
|
|
|
public interface ISerializableDictionary<TKey, TValue> : IDictionary<TKey, TValue>, IXunitSerializable
|
|
{
|
|
}
|
|
|
|
public class SerializableDictionary<TKey, TValue>
|
|
: Dictionary<TKey, TValue>, ISerializableDictionary<TKey, TValue> where TKey : notnull
|
|
{
|
|
public SerializableDictionary() { }
|
|
|
|
public SerializableDictionary(IDictionary<TKey, TValue> dictionary) : base(dictionary)
|
|
{
|
|
}
|
|
|
|
public void Deserialize(IXunitSerializationInfo info)
|
|
{
|
|
Clear();
|
|
|
|
var keysJson = info.GetValue<string>("_DictKeys") ?? "[]";
|
|
var valuesJson = info.GetValue<string>("_DictValues") ?? "[]";
|
|
var keys = JsonSerializer.Deserialize<List<TKey>>(keysJson);
|
|
var values = JsonSerializer.Deserialize<List<TValue>>(valuesJson);
|
|
|
|
if (keys is null || values is null || keys.Count != values.Count)
|
|
{
|
|
return;
|
|
}
|
|
|
|
for (var i = 0; i < keys.Count; i++)
|
|
{
|
|
Add(keys[i], values[i]);
|
|
}
|
|
}
|
|
|
|
public void Serialize(IXunitSerializationInfo info)
|
|
{
|
|
info.AddValue("_DictKeys", JsonSerializer.Serialize(Keys));
|
|
info.AddValue("_DictValues", JsonSerializer.Serialize(Values));
|
|
}
|
|
} |