Esempio n. 1
0
        public void TestUpdate2()
        {
            SpreadsheetViewStub stub       = new SpreadsheetViewStub();
            Controller          controller = new Controller(stub);

            stub.CellName = "A1";
            stub.FireUpdateEvent("10");
            stub.FireUpdateEvent("=a1");

            Assert.AreEqual(stub.Message.Substring(0, 8), "Error: \n");
            Assert.AreEqual(stub.CellContent, "10");
        }
Esempio n. 2
0
        public void TestUpdate1()
        {
            SpreadsheetViewStub stub       = new SpreadsheetViewStub();
            Controller          controller = new Controller(stub);

            stub.CellName = "A1";
            stub.FireUpdateEvent("10");

            Assert.AreEqual(stub.Row, 0);
            Assert.AreEqual(stub.Col, 0);
            Assert.AreEqual(stub.CellValue, "10");
            Assert.AreEqual(stub.CellContent, "10");
            Assert.IsTrue(stub.Changed);
        }