Skip to content

Commit

Permalink
test(undo-manager): remove comments about indexes for Observe* events…
Browse files Browse the repository at this point in the history
… for UndoManager
  • Loading branch information
LSViana committed Sep 5, 2023
1 parent 49c7e5e commit c8d69b7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 55 deletions.
24 changes: 1 addition & 23 deletions Tests/YDotNet.Tests.Unit/UndoManagers/ObserveAddedTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ public void TriggersAfterAddingAndRemovingContentOnText()
Assert.That(undoEvent, Is.Not.Null);
Assert.That(undoEvent.Kind, Is.EqualTo(UndoEventKind.Redo));
Assert.That(undoEvent.Origin, Is.Null);

// TODO [LSViana] Check with the team why the indexes are [0, 2] and [8, 11] here.
AssertDeleteSet(
undoEvent.Deletions,
(1234, new[] { new IdRange(start: 0, end: 2), new IdRange(start: 8, end: 11) }));
Expand Down Expand Up @@ -115,7 +113,7 @@ public void TriggersAfterAddingAndRemovingContentOnArray()
array.InsertRange(
transaction, index: 2, new[]
{
Input.Bytes(new byte[] { 2, 4, 6, 9, 123, 123 }),
Input.Bytes(new byte[] { 2, 4, 6, 9 }),
Input.XmlText("Lucas")
});
transaction.Commit();
Expand All @@ -125,8 +123,6 @@ public void TriggersAfterAddingAndRemovingContentOnArray()
Assert.That(undoEvent.Kind, Is.EqualTo(UndoEventKind.Redo));
Assert.That(undoEvent.Origin, Is.Null);
AssertDeleteSet(undoEvent.Deletions);

// TODO [LSViana] Check with the team why the indexes are [3, 10] here.
AssertDeleteSet(undoEvent.Insertions, (5678, new[] { new IdRange(start: 3, end: 10) }));

// Act
Expand All @@ -140,8 +136,6 @@ public void TriggersAfterAddingAndRemovingContentOnArray()
Assert.That(undoEvent.Kind, Is.EqualTo(UndoEventKind.Redo));
Assert.That(undoEvent.Origin, Is.Null);
AssertDeleteSet(undoEvent.Insertions);

// TODO [LSViana] Check with the team why the indexes are [1, 2] and [3, 4] here.
AssertDeleteSet(
undoEvent.Deletions, (5678, new[] { new IdRange(start: 1, end: 2), new IdRange(start: 3, end: 4) }));
}
Expand Down Expand Up @@ -187,8 +181,6 @@ public void TriggersAfterAddingAndRemovingContentOnMap()
Assert.That(undoEvent.Kind, Is.EqualTo(UndoEventKind.Redo));
Assert.That(undoEvent.Origin, Is.Null);
AssertDeleteSet(undoEvent.Deletions);

// TODO [LSViana] Check with the team why the indexes are [0, 3] here.
AssertDeleteSet(undoEvent.Insertions, (9012, new[] { new IdRange(start: 3, end: 10) }));

// Act
Expand Down Expand Up @@ -245,8 +237,6 @@ public void TriggersAfterAddingAndRemovingContentOnXmlText()
Assert.That(undoEvent.Kind, Is.EqualTo(UndoEventKind.Redo));
Assert.That(undoEvent.Origin, Is.Null);
AssertDeleteSet(undoEvent.Deletions);

// TODO [LSViana] Check with the team why the indexes are [5, 6] here.
AssertDeleteSet(undoEvent.Insertions, (7853, new[] { new IdRange(start: 5, end: 6) }));

// Act
Expand All @@ -260,8 +250,6 @@ public void TriggersAfterAddingAndRemovingContentOnXmlText()
Assert.That(undoEvent.Kind, Is.EqualTo(UndoEventKind.Redo));
Assert.That(undoEvent.Origin, Is.Null);
AssertDeleteSet(undoEvent.Deletions);

// TODO [LSViana] Check with the team why the indexes are [6, 7] here.
AssertDeleteSet(undoEvent.Insertions, (7853, new[] { new IdRange(start: 6, end: 7) }));

// Act
Expand All @@ -275,8 +263,6 @@ public void TriggersAfterAddingAndRemovingContentOnXmlText()
Assert.That(undoEvent.Kind, Is.EqualTo(UndoEventKind.Redo));
Assert.That(undoEvent.Origin, Is.Null);
AssertDeleteSet(undoEvent.Insertions);

// TODO [LSViana] Check with the team why the indexes are [2, 3] and [6, 7] here.
AssertDeleteSet(
undoEvent.Deletions, (7853, new[] { new IdRange(start: 2, end: 3), new IdRange(start: 6, end: 7) }));
}
Expand Down Expand Up @@ -332,8 +318,6 @@ public void TriggersAfterAddingAndRemovingContentOnXmlElement()
Assert.That(undoEvent.Kind, Is.EqualTo(UndoEventKind.Redo));
Assert.That(undoEvent.Origin, Is.Null);
AssertDeleteSet(undoEvent.Deletions);

// TODO [LSViana] Check with the team why the indexes are [6, 7] here.
AssertDeleteSet(undoEvent.Insertions, (8137, new[] { new IdRange(start: 6, end: 7) }));

// Act
Expand All @@ -347,8 +331,6 @@ public void TriggersAfterAddingAndRemovingContentOnXmlElement()
Assert.That(undoEvent.Kind, Is.EqualTo(UndoEventKind.Redo));
Assert.That(undoEvent.Origin, Is.Null);
AssertDeleteSet(undoEvent.Deletions);

// TODO [LSViana] Check with the team why the indexes are [7, 8] here.
AssertDeleteSet(undoEvent.Insertions, (8137, new[] { new IdRange(start: 7, end: 8) }));

// Act
Expand All @@ -363,8 +345,6 @@ public void TriggersAfterAddingAndRemovingContentOnXmlElement()
Assert.That(undoEvent.Kind, Is.EqualTo(UndoEventKind.Redo));
Assert.That(undoEvent.Origin, Is.Null);
AssertDeleteSet(undoEvent.Deletions);

// TODO [LSViana] Check with the team why the indexes are [8, 14] here.
AssertDeleteSet(undoEvent.Insertions, (8137, new[] { new IdRange(start: 8, end: 14) }));

// Act
Expand All @@ -378,8 +358,6 @@ public void TriggersAfterAddingAndRemovingContentOnXmlElement()
Assert.That(undoEvent.Kind, Is.EqualTo(UndoEventKind.Redo));
Assert.That(undoEvent.Origin, Is.Null);
AssertDeleteSet(undoEvent.Insertions);

// TODO [LSViana] Check with the team why the indexes are [7, 14] here.
AssertDeleteSet(
undoEvent.Deletions, (8137, new[] { new IdRange(start: 7, end: 14) }));
}
Expand Down
32 changes: 0 additions & 32 deletions Tests/YDotNet.Tests.Unit/UndoManagers/ObservePoppedTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ public void TriggersAfterAddingAndRemovingContentOnText()
Assert.That(undoEvent, Is.Not.Null);
Assert.That(undoEvent.Kind, Is.EqualTo(UndoEventKind.Undo));
Assert.That(undoEvent.Origin, Is.Not.Null);

// TODO [LSViana] Check with the team why the indexes are [8, 10] here.
AssertDeleteSet(undoEvent.Deletions, (1234, new[] { new IdRange(start: 8, end: 10) }));
AssertDeleteSet(undoEvent.Insertions);

Expand All @@ -70,8 +68,6 @@ public void TriggersAfterAddingAndRemovingContentOnText()
Assert.That(undoEvent.Kind, Is.EqualTo(UndoEventKind.Redo));
Assert.That(undoEvent.Origin, Is.Not.Null);
AssertDeleteSet(undoEvent.Deletions);

// TODO [LSViana] Check with the team why the indexes are [10, 12] here.
AssertDeleteSet(undoEvent.Insertions, (1234, new[] { new IdRange(start: 10, end: 12) }));
}

Expand Down Expand Up @@ -127,8 +123,6 @@ public void TriggersAfterAddingAndRemovingContentOnArray()
Assert.That(undoEvent, Is.Not.Null);
Assert.That(undoEvent.Kind, Is.EqualTo(UndoEventKind.Undo));
Assert.That(undoEvent.Origin, Is.Not.Null);

// TODO [LSViana] Check with the team why the indexes are [1, 4] here.
AssertDeleteSet(undoEvent.Deletions, (5678, new[] { new IdRange(start: 4, end: 6) }));
AssertDeleteSet(undoEvent.Insertions);

Expand All @@ -141,8 +135,6 @@ public void TriggersAfterAddingAndRemovingContentOnArray()
Assert.That(undoEvent.Kind, Is.EqualTo(UndoEventKind.Redo));
Assert.That(undoEvent.Origin, Is.Not.Null);
AssertDeleteSet(undoEvent.Deletions);

// TODO [LSViana] Check with the team why the indexes are [6, 8] here.
AssertDeleteSet(undoEvent.Insertions, (5678, new[] { new IdRange(start: 6, end: 8) }));
}

Expand Down Expand Up @@ -254,8 +246,6 @@ public void TriggersAfterAddingAndRemovingContentOnXmlText()
Assert.That(undoEvent.Kind, Is.EqualTo(UndoEventKind.Undo));
Assert.That(undoEvent.Origin, Is.Not.Null);
AssertDeleteSet(undoEvent.Deletions);

// TODO [LSViana] Check with the team why the indexes are [10, 11] here.
AssertDeleteSet(undoEvent.Insertions, (7938, new[] { new IdRange(start: 10, end: 11) }));

// Act
Expand All @@ -266,8 +256,6 @@ public void TriggersAfterAddingAndRemovingContentOnXmlText()
Assert.That(undoEvent, Is.Not.Null);
Assert.That(undoEvent.Kind, Is.EqualTo(UndoEventKind.Redo));
Assert.That(undoEvent.Origin, Is.Not.Null);

// TODO [LSViana] Check with the team why the indexes are [10, 11] here.
AssertDeleteSet(undoEvent.Deletions, (7938, new[] { new IdRange(start: 10, end: 11) }));
AssertDeleteSet(undoEvent.Insertions);

Expand All @@ -282,8 +270,6 @@ public void TriggersAfterAddingAndRemovingContentOnXmlText()
Assert.That(undoEvent, Is.Not.Null);
Assert.That(undoEvent.Kind, Is.EqualTo(UndoEventKind.Undo));
Assert.That(undoEvent.Origin, Is.Not.Null);

// TODO [LSViana] Check with the team why the indexes are [7, 10] here.
AssertDeleteSet(undoEvent.Deletions, (7938, new[] { new IdRange(start: 7, end: 10) }));
AssertDeleteSet(undoEvent.Insertions);

Expand All @@ -296,8 +282,6 @@ public void TriggersAfterAddingAndRemovingContentOnXmlText()
Assert.That(undoEvent.Kind, Is.EqualTo(UndoEventKind.Redo));
Assert.That(undoEvent.Origin, Is.Not.Null);
AssertDeleteSet(undoEvent.Deletions);

// TODO [LSViana] Check with the team why the indexes are [12, 15] here.
AssertDeleteSet(undoEvent.Insertions, (7938, new[] { new IdRange(start: 12, end: 15) }));
}

Expand All @@ -323,8 +307,6 @@ public void TriggersAfterAddingAndRemovingContentOnXmlElement()
Assert.That(undoEvent.Kind, Is.EqualTo(UndoEventKind.Undo));
Assert.That(undoEvent.Origin, Is.Not.Null);
AssertDeleteSet(undoEvent.Deletions);

// TODO [LSViana] Check with the team why the indexes are [0, 1] here.
AssertDeleteSet(undoEvent.Insertions, (5903, new[] { new IdRange(start: 0, end: 1) }));

// Act (redo add element)
Expand All @@ -335,8 +317,6 @@ public void TriggersAfterAddingAndRemovingContentOnXmlElement()
Assert.That(undoEvent, Is.Not.Null);
Assert.That(undoEvent.Kind, Is.EqualTo(UndoEventKind.Redo));
Assert.That(undoEvent.Origin, Is.Not.Null);

// TODO [LSViana] Check with the team why the indexes are [0, 1] here.
AssertDeleteSet(undoEvent.Deletions, (5903, new[] { new IdRange(start: 0, end: 1) }));
AssertDeleteSet(undoEvent.Insertions);

Expand All @@ -352,8 +332,6 @@ public void TriggersAfterAddingAndRemovingContentOnXmlElement()
Assert.That(undoEvent.Kind, Is.EqualTo(UndoEventKind.Undo));
Assert.That(undoEvent.Origin, Is.Not.Null);
AssertDeleteSet(undoEvent.Deletions);

// TODO [LSViana] Check with the team why the indexes are [2, 3] here.
AssertDeleteSet(undoEvent.Insertions, (5903, new[] { new IdRange(start: 2, end: 3) }));

// Act (redo add attribute)
Expand All @@ -364,8 +342,6 @@ public void TriggersAfterAddingAndRemovingContentOnXmlElement()
Assert.That(undoEvent, Is.Not.Null);
Assert.That(undoEvent.Kind, Is.EqualTo(UndoEventKind.Redo));
Assert.That(undoEvent.Origin, Is.Not.Null);

// TODO [LSViana] Check with the team why the indexes are [2, 3] here.
AssertDeleteSet(undoEvent.Deletions, (5903, new[] { new IdRange(start: 2, end: 3) }));
AssertDeleteSet(undoEvent.Insertions);

Expand All @@ -380,8 +356,6 @@ public void TriggersAfterAddingAndRemovingContentOnXmlElement()
Assert.That(undoEvent.Kind, Is.EqualTo(UndoEventKind.Undo));
Assert.That(undoEvent.Origin, Is.Not.Null);
AssertDeleteSet(undoEvent.Deletions);

// TODO [LSViana] Check with the team why the indexes are [4, 5] here.
AssertDeleteSet(undoEvent.Insertions, (5903, new[] { new IdRange(start: 4, end: 5) }));

// Act (redo add text)
Expand All @@ -404,8 +378,6 @@ public void TriggersAfterAddingAndRemovingContentOnXmlElement()
Assert.That(undoEvent, Is.Not.Null);
Assert.That(undoEvent.Kind, Is.EqualTo(UndoEventKind.Undo));
Assert.That(undoEvent.Origin, Is.Not.Null);

// TODO [LSViana] Check with the team why the indexes are [1, 2] and [5, 6] here.
AssertDeleteSet(
undoEvent.Deletions, (5903, new[] { new IdRange(start: 1, end: 2), new IdRange(start: 5, end: 6) }));
AssertDeleteSet(undoEvent.Insertions);
Expand All @@ -419,8 +391,6 @@ public void TriggersAfterAddingAndRemovingContentOnXmlElement()
Assert.That(undoEvent.Kind, Is.EqualTo(UndoEventKind.Redo));
Assert.That(undoEvent.Origin, Is.Not.Null);
AssertDeleteSet(undoEvent.Deletions);

// TODO [LSViana] Check with the team why the indexes are [6, 8] here.
AssertDeleteSet(undoEvent.Insertions, (5903, new[] { new IdRange(start: 6, end: 8) }));

// Act (remove attribute and undo)
Expand All @@ -434,8 +404,6 @@ public void TriggersAfterAddingAndRemovingContentOnXmlElement()
Assert.That(undoEvent, Is.Not.Null);
Assert.That(undoEvent.Kind, Is.EqualTo(UndoEventKind.Undo));
Assert.That(undoEvent.Origin, Is.Not.Null);

// TODO [LSViana] Check with the team why the indexes are [3, 4] here.
AssertDeleteSet(undoEvent.Deletions, (5903, new[] { new IdRange(start: 3, end: 4) }));
AssertDeleteSet(undoEvent.Insertions);

Expand Down

0 comments on commit c8d69b7

Please sign in to comment.