Exemplo n.º 1
0
        public void SaveFile02()
        {
            SpreadsheetViewStub stub       = new SpreadsheetViewStub();
            Controller          controller = new Controller(stub);

            stub.FireSaveEvent("Unsaved Spreadsheet");
            Assert.IsTrue(stub.CalledSaveEvent);
        }
Exemplo n.º 2
0
        public void TestSave1()
        {
            SpreadsheetViewStub stub       = new SpreadsheetViewStub();
            Controller          controller = new Controller(stub);

            stub.FireSaveEvent(null);
            Assert.AreEqual(stub.Message.Substring(0, 20), "Unable to save file\n");
        }
Exemplo n.º 3
0
        public void TestSave2()
        {
            SpreadsheetViewStub stub       = new SpreadsheetViewStub();
            Controller          controller = new Controller(stub);

            stub.FireSaveEvent("spreadsheet2.ss");
            Assert.IsFalse(stub.Changed);
            Assert.AreEqual(stub.Message, null);
            Assert.AreEqual(stub.Title, "spreadsheet2.ss");
        }
Exemplo n.º 4
0
        public void SaveFile01()
        {
            SpreadsheetViewStub stub       = new SpreadsheetViewStub();
            Controller          controller = new Controller(stub);

            stub.FireFileChosenEvent("../../demo1.ss");
            Assert.AreEqual("../../demo1.ss", stub.Title);

            stub.FireSaveEvent("../../demo1.ss");
            Assert.IsTrue(stub.CalledSaveEvent);
        }
Exemplo n.º 5
0
        public void Test5()
        {
            SpreadsheetViewStub stub       = new SpreadsheetViewStub();
            Controller          controller = new Controller(stub);

            stub.FireCellContentsChange("A1", "CS 1410");
            stub.FireCellContentsChange("A2", "CS 2420");
            stub.FireCellContentsChange("A3", "CS 3500");
            stub.FireCellContentsChange("A4", "CS 3810");

            stub.FireSaveEvent("savedSpreadsheet1.xml");
            Assert.IsFalse(stub.DidSendMessage);
        }
Exemplo n.º 6
0
        public void SaveFile05()
        {
            SpreadsheetViewStub stub       = new SpreadsheetViewStub();
            Controller          controller = new Controller(stub);

            stub.FireFileChosenEvent("../../demo1.ss");
            Assert.AreEqual("../../demo1.ss", stub.Title);

            // Make a change
            stub.FireEvaluateClicked("A2", "4");

            // Save the file
            stub.FireSaveEvent("../../demo1.ss");
            Assert.IsTrue(stub.CalledSaveEvent);
        }