Beispiel #1
0
        public void DeleteOperation_CreateInverse_CreatesInsertOperation()
        {
            var state  = new DocumentState(1, "1234");
            var delete = new DeleteOperation(state, 2);

            Assert.IsInstanceOfType(delete.CreateInverse(state), typeof(InsertOperation));
        }
Beispiel #2
0
        public void DeleteOperation_CreateInverse_InverseUndoesDelete()
        {
            var state        = new DocumentState(1, "1234");
            var delete       = new DeleteOperation(state, 2);
            var deletedstate = delete.ApplyTransform(state.CurrentState);

            Assert.AreEqual(state.CurrentState, delete.CreateInverse(state).ApplyTransform(deletedstate));
        }