fix: isolate payment amount evidence
This commit is contained in:
@@ -3,8 +3,9 @@ using System.Net;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Net.Http.Json;
|
||||
using System.Reflection;
|
||||
using System.Text.Json;
|
||||
using MiaoJiZhang.Api.Services;
|
||||
using System.Text.Json;
|
||||
using MiaoJiZhang.Api.Controllers;
|
||||
using MiaoJiZhang.Api.Services;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Mvc.Testing;
|
||||
using Microsoft.AspNetCore.TestHost;
|
||||
@@ -859,6 +860,29 @@ public sealed class RecognitionBatchActionParserTests
|
||||
Assert.Equal(1, action.Confidence);
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class RecognitionAmountUpdateEvidenceTests
|
||||
{
|
||||
private static readonly IReadOnlyDictionary<string, string?> EvidenceOwners =
|
||||
new Dictionary<string, string?>
|
||||
{
|
||||
["evidence-a"] = "candidate-a",
|
||||
["evidence-b"] = "candidate-b"
|
||||
};
|
||||
|
||||
[Fact]
|
||||
public void AmountUpdateRequiresLinkedEvidenceAndHighConfidence()
|
||||
{
|
||||
Assert.False(ParseController.CanApplyAmountUpdate(
|
||||
"candidate-a", null, 0.99, EvidenceOwners));
|
||||
Assert.False(ParseController.CanApplyAmountUpdate(
|
||||
"candidate-a", "evidence-a", 0.89, EvidenceOwners));
|
||||
Assert.False(ParseController.CanApplyAmountUpdate(
|
||||
"candidate-a", "evidence-b", 0.99, EvidenceOwners));
|
||||
Assert.True(ParseController.CanApplyAmountUpdate(
|
||||
"candidate-a", "evidence-a", 0.9, EvidenceOwners));
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class BudgetRecommendationValidationTests
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user