Source identity
| Field | Recorded value |
|---|---|
| Source type | GitHub source |
| Original record | Janady13/AI_Brain / tests/test_bulk_update.cs |
| Date | Not specified in source |
| Repository | Janady13/AI_Brain |
| Revision | 6d0767aad08781eb5c4e1eb14a42ec92c437be78 |
| Branch | copilot/convert-python-files-to-csharp |
| Path or archive member | tests/test_bulk_update.cs |
| Original SHA-256 | b3054ef04230eb012279e1acb57f209cd72f5ef583e2846bed83b3ce44d6c00c |
| Git blob SHA | 8313b4dee29e7dbc0d08ab4587acfcb2959259c8 |
| Reading-copy SHA-256 | b3054ef04230eb012279e1acb57f209cd72f5ef583e2846bed83b3ce44d6c00c |
Recovered source transcript
Download complete source text ↓56 lines · 1.4 KB
// Tests for bulk update functionality
using System;
using AIBrain.Scripts;
using Xunit;
namespace AIBrain.Tests
{
public class TestBulkUpdate
{
[Fact]
public void TestExecuteBulkUpdatesDryRun()
{
var result = BulkUpdate.ExecuteBulkUpdates(
iterations: 100,
batchSize: 10,
dryRun: true
);
Assert.NotNull(result);
Assert.True(result.DryRun);
Assert.True(result.ExecutedIterations > 0);
Assert.True(result.SampleRuntimeSeconds > 0);
}
[Fact]
public void TestBulkUpdatePlanToDict()
{
var plan = new BulkUpdatePlan
{
Iterations = 1000,
BatchSize = 100,
ExecutedIterations = 5,
DryRun = true,
SampleRuntimeSeconds = 1.5,
EstimatedTotalRuntimeSeconds = 300.0
};
var dict = plan.ToDict();
Assert.Equal(1000, dict["iterations"]);
Assert.Equal(100, dict["batch_size"]);
Assert.Equal(5, dict["executed_iterations"]);
Assert.True((bool)dict["dry_run"]);
}
[Fact]
public void TestInvalidIterations()
{
Assert.Throws<ArgumentException>(() =>
BulkUpdate.ExecuteBulkUpdates(iterations: 0)
);
}
}
}