public void TestNewSpreadsheet() { SpreadsheetStubView window = new SpreadsheetStubView(); Controller controller = new Controller(window); window.FireNewSpreadsheetEvent(); Assert.AreEqual("OpenNew", window.lastMethodCalled); }
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(); }