コード例 #1
0
        public void TestSaveSpreadsheet()
        {
            SpreadsheetStubView window     = new SpreadsheetStubView();
            Controller          controller = new Controller(window);

            window.FireCellContentsSetEvent("A5", "dog");
            window.FireCellContentsSetEvent("A1", "=A5");
            window.FireSaveSpreadsheetEvent();
        }
コード例 #2
0
        public void TestMethod2()
        {
            SpreadsheetStubView window     = new SpreadsheetStubView();
            Controller          controller = new Controller("Test.ss", window);

            window.FireCellContentsSetEvent("B7", "cat");
            Assert.AreEqual("DisplayValue", window.lastMethodCalled);
            Assert.AreEqual("cat", window.currentValue);
            window.FireCellContentsSetEvent("A3", "15");
            Assert.AreEqual("15", window.currentValue);
            window.FireCellContentsSetEvent("A1", "=A1");
            Assert.AreEqual("ShowCircularExceptionBox", window.lastMethodCalled);
            window.FireCellContentsSetEvent("A1", "=A100");
            Assert.AreEqual("ShowFormulaExceptionBox", window.lastMethodCalled);
            window.FireCloseSpreadsheetEvent(false);
            Assert.AreEqual("WarnClose", window.lastMethodCalled);
            window.FireCloseSpreadsheetEvent(true);
            Assert.AreEqual("DoClose", window.lastMethodCalled);
            window.FireNewSpreadsheetEvent();
            Assert.AreEqual("OpenNew", window.lastMethodCalled);
            window.FireSaveSpreadsheetEvent();
            window.FireOpenSpreadsheetEvent();
        }