in code/KustoCopyTest/InMemoryCache/IterationTest.cs [44:77]
public void UpdateEmptyIteration()
{
var cache = new RowItemInMemoryCache(Array.Empty<RowItemBase>());
var iterationId = 1;
var state1 = IterationState.Planning;
var state2 = IterationState.Planned;
var item = new IterationRowItem
{
State = state1,
ActivityName = ACTIVITY_NAME,
IterationId = iterationId,
CursorEnd = "ABC"
};
cache = cache.AppendItem(new ActivityRowItem
{
State = ActivityState.Active,
ActivityName = ACTIVITY_NAME,
SourceTable = SOURCE_TABLE_IDENTITY,
DestinationTable = DESTINATION_TABLE_IDENTITY
});
cache = cache.AppendItem(item);
Assert.Equal(
state1,
cache.ActivityMap[ACTIVITY_NAME].IterationMap[iterationId].RowItem.State);
// Update
cache = cache.AppendItem(item.ChangeState(state2));
Assert.Equal(
state2,
cache.ActivityMap[ACTIVITY_NAME].IterationMap[iterationId].RowItem.State);
}