Learn slippage from real executions and say discoveries in plain words
The monthly regression raises an estimate by itself and lowers one only on real money and with the confirmation of the user in the Laboratorio. The table of what news does to prices and the fixed list of questions on the clues are informative only. refs #65 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
df21962da3
commit
14e8a872dc
15 files changed
+1060
-22
No files matched your search
@@ -68,6 +68,47 @@ public sealed class LaboratoryScreenTests
|
||||
StringAssert.Contains(await missing.Content.ReadAsStringAsync(), "Test non trovato.");
|
||||
}
|
||||
|
||||
/// <summary>SPEC 11.6: a lower slippage waits in the Laboratorio for the confirmation of the user.</summary>
|
||||
[TestMethod]
|
||||
[TestCategory(Category.Integration)]
|
||||
public async Task ALowerCostIsConfirmedFromTheLaboratory()
|
||||
{
|
||||
await using var server = await ServerHarness.StartAsync("docker", ServerHarness.DockerSqlite());
|
||||
await server.SignInFirstTimeAsync();
|
||||
var db = server.Host.Services!.Db;
|
||||
async Task<Guid> PendingAsync(decimal bp)
|
||||
{
|
||||
var id = Ids.NewId(SystemClock.Instance);
|
||||
await db.WriteAsync(s => s.ExecuteAsync(
|
||||
"INSERT INTO cost_estimates (id, tier, status, previous_bp, bp, measured_bp, low_bp, high_bp, cases, created_at, updated_at) VALUES (@id, 'crypto_minor', 'pending', @p, @b, @b, @b, @b, 40, @now, @now)",
|
||||
CancellationToken.None, ("id", id), ("p", 15m), ("b", bp), ("now", DateTimeOffset.UtcNow)));
|
||||
return id;
|
||||
}
|
||||
|
||||
var refused = await PendingAsync(9m);
|
||||
StringAssert.Contains(await server.TextAsync("/laboratorio"), "Altre crypto: da 15 punti base a 9 punti base.");
|
||||
using (var no = await server.PostFormAsync("/laboratorio", $"/azioni/stime-di-costo/{refused}/rifiuta", []))
|
||||
{
|
||||
Assert.AreEqual("/laboratorio#stime", ServerHarness.Location(no));
|
||||
}
|
||||
|
||||
using (var late = await server.PostFormAsync("/laboratorio", $"/azioni/stime-di-costo/{refused}/conferma", []))
|
||||
{
|
||||
Assert.AreEqual("/laboratorio?errore=stima#stime", ServerHarness.Location(late));
|
||||
}
|
||||
|
||||
var confirmed = await PendingAsync(8m);
|
||||
using (var yes = await server.PostFormAsync("/laboratorio", $"/azioni/stime-di-costo/{confirmed}/conferma", []))
|
||||
{
|
||||
Assert.AreEqual("/laboratorio#stime", ServerHarness.Location(yes));
|
||||
}
|
||||
|
||||
var page = await server.TextAsync("/laboratorio");
|
||||
StringAssert.Contains(page, "altre crypto 8 punti base");
|
||||
StringAssert.Contains(page, "Confermata da te");
|
||||
StringAssert.Contains(page, "Rifiutata da te");
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[TestCategory(Category.Integration)]
|
||||
public async Task TheDemoRunsNoTests()
|
||||
|
||||
Reference in new issue
Block a user