refactor(infra,api.tests): fix my null lies
This commit is contained in:
@@ -4,9 +4,9 @@ public sealed class Account : Entity
|
|||||||
{
|
{
|
||||||
public Guid UserId { get; init; }
|
public Guid UserId { get; init; }
|
||||||
public Guid InstitutionId { get; init; }
|
public Guid InstitutionId { get; init; }
|
||||||
public Institution Institution { get; init; } = null!;
|
public Institution? Institution { get; init; }
|
||||||
public string Name { get; init; } = string.Empty;
|
public string Name { get; init; } = string.Empty;
|
||||||
public AccountMetadata Metadata { get; init; } = null!;
|
public AccountMetadata? Metadata { get; init; }
|
||||||
|
|
||||||
public static Account From(Guid institutionId, string name, AccountMetadata accountMetadata)
|
public static Account From(Guid institutionId, string name, AccountMetadata accountMetadata)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ public sealed class Institution : Entity
|
|||||||
{
|
{
|
||||||
public Guid UserId { get; init; }
|
public Guid UserId { get; init; }
|
||||||
public string Name { get; init; } = string.Empty;
|
public string Name { get; init; } = string.Empty;
|
||||||
public InstitutionMetadata Metadata { get; init; } = null!;
|
public InstitutionMetadata? Metadata { get; init; }
|
||||||
|
|
||||||
private Institution()
|
private Institution()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -222,8 +222,8 @@ public class AddTests(TestApi testApi) : IntegrationTest(testApi)
|
|||||||
|
|
||||||
var json = JsonSerializer.Serialize(new
|
var json = JsonSerializer.Serialize(new
|
||||||
{
|
{
|
||||||
plaidInstitutionId = ((PlaidMetadata)institution.Metadata).PlaidId,
|
plaidInstitutionId = ((PlaidMetadata)institution.Metadata!).PlaidId,
|
||||||
plaidAccountId = ((PlaidAccountMetadata)account.Metadata).PlaidId,
|
plaidAccountId = ((PlaidAccountMetadata)account.Metadata!).PlaidId,
|
||||||
plaidAccountName = ((PlaidAccountMetadata)account.Metadata).PlaidName,
|
plaidAccountName = ((PlaidAccountMetadata)account.Metadata).PlaidName,
|
||||||
});
|
});
|
||||||
using var content = new StringContent(json, Encoding.UTF8, "application/json");
|
using var content = new StringContent(json, Encoding.UTF8, "application/json");
|
||||||
@@ -270,7 +270,7 @@ public class AddTests(TestApi testApi) : IntegrationTest(testApi)
|
|||||||
|
|
||||||
var json = JsonSerializer.Serialize(new
|
var json = JsonSerializer.Serialize(new
|
||||||
{
|
{
|
||||||
plaidInstitutionId = ((PlaidMetadata)institution.Metadata).PlaidId,
|
plaidInstitutionId = ((PlaidMetadata)institution.Metadata!).PlaidId,
|
||||||
plaidAccountId = newAccountId,
|
plaidAccountId = newAccountId,
|
||||||
plaidAccountName = newAccountName,
|
plaidAccountName = newAccountName,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ public class ConnectTests(TestApi testApi) : IntegrationTest(testApi)
|
|||||||
var json = JsonSerializer.Serialize(new
|
var json = JsonSerializer.Serialize(new
|
||||||
{
|
{
|
||||||
publicToken = "token",
|
publicToken = "token",
|
||||||
plaidInstitutionId = ((PlaidMetadata)institution.Metadata).PlaidId,
|
plaidInstitutionId = ((PlaidMetadata)institution.Metadata!).PlaidId,
|
||||||
});
|
});
|
||||||
using var content = new StringContent(json, Encoding.UTF8, "application/json");
|
using var content = new StringContent(json, Encoding.UTF8, "application/json");
|
||||||
using var request = new HttpRequestMessage(HttpMethod.Post, ConnectUri)
|
using var request = new HttpRequestMessage(HttpMethod.Post, ConnectUri)
|
||||||
|
|||||||
Reference in New Issue
Block a user