Exemple #1
0
        public void TestContentsBox()
        {
            SpreadsheetViewStub stub = new SpreadsheetViewStub();

            stub.spreadSheetPanel = new SpreadsheetPanel();
            Controller controller = new Controller(stub);

            stub.FireContentsEvent();
            Assert.AreEqual("Cannot change cell contents to " + null + " because: " + "Value cannot be null.", stub.Message);
        }
Exemple #2
0
        public void TestContentsBox2()
        {
            SpreadsheetViewStub stub = new SpreadsheetViewStub();

            stub.spreadSheetPanel = new SpreadsheetPanel();
            Controller controller = new Controller(stub);

            stub.FireFileChosenEvent("../../testing1.ss");
            stub.Contents = "2";
            stub.FireContentsEvent();
            Assert.AreEqual("2", stub.Value);
        }
Exemple #3
0
        public void TestXClose()
        {
            SpreadsheetViewStub stub = new SpreadsheetViewStub();

            stub.spreadSheetPanel = new SpreadsheetPanel();
            Controller controller = new Controller(stub);

            stub.FireFileChosenEvent("../../testing1.ss");
            stub.Contents = "2";
            stub.FireContentsEvent();
            FormClosingEventArgs e;

            e = new FormClosingEventArgs(CloseReason.UserClosing, true);
            stub.FireXCloseEvent(e);
            Assert.AreEqual(true, e.Cancel);
        }