public void InsertOperation_CreateInverse_CreatesDeleteOperation() { var state = new DocumentState(1, "123456789"); var insert = new InsertOperation(state, 2, 'x'); Assert.IsInstanceOfType(insert.CreateInverse(state), typeof(DeleteOperation)); }
public void InsertOperation_CreateInverse_InverseUndoesInsert() { var state = new DocumentState(1, "123456789"); var insert = new InsertOperation(state, 2, 'x'); var insertedstate = insert.ApplyTransform(state.CurrentState); Assert.AreEqual(state.CurrentState, insert.CreateInverse(state).ApplyTransform(insertedstate)); }