Ejemplo n.º 1
0
        public void TestingClearStack()
        {
            List <string> undoInput = new List <string>();
            SpreadSheet   test      = new SpreadSheet(50, 26);

            undoInput.Add("0");
            undoInput.Add("0");
            undoInput.Add("color");
            undoInput.Add("4294967295");
            test.AddUndo(undoInput);
            test.ClearStacks();
            Assert.AreEqual(test.DetermineUndo(), -1);
        }
Ejemplo n.º 2
0
        public void TestingColorUndoRedo()
        {
            List <string> undoInput = new List <string>();
            SpreadSheet   test      = new SpreadSheet(50, 26);

            test.GetCell(1, 0).Color = 4286644096;
            undoInput.Add("0");
            undoInput.Add("0");
            undoInput.Add("color");
            undoInput.Add("4294967295");
            test.AddUndo(undoInput);
            test.Undo();
            Assert.AreEqual(test.GetCell(1, 0).Color.ToString(), "4294967295");
            test.Redo();
            Assert.AreEqual(test.GetCell(1, 0).Color.ToString(), "4286644096");
        }
Ejemplo n.º 3
0
        public void TestingUndoRedo()
        {
            List <string> undoInput = new List <string>();
            SpreadSheet   test      = new SpreadSheet(50, 26);

            test.GetCell(1, 0).Text = "50";
            undoInput.Add("0");
            undoInput.Add("0");
            undoInput.Add("txt");
            undoInput.Add(string.Empty);
            test.AddUndo(undoInput);
            test.Undo();
            Assert.AreEqual(string.Empty, test.GetCell(1, 0).ValueStr);
            test.Redo();
            Assert.AreEqual(test.GetCell(1, 0).ValueStr, "50");
        }