Esempio n. 1
0
        public void testModeChangeChallenges()
        {
            var gui      = new FakeFerretControlGui();
            var control  = new FerretControl(gui, ferretStatus);
            var messages = new List <Fields>();

            FerretControl.onOutgoing(messages.Add);
            control.setRandomSeed(12345);
            control.changeStatus("Stage");
            AreEqual("Stage", gui.status());
            gui.stageAnswer(YesNoCancel.YES);
            control.onTicketPressed();
            gui.hasMessage("Are you not not sure?");
            gui.waitMatches(1, () => messages.Count);
            messages.Clear();
            control.setReadonly(true);
            gui.stageAnswer(YesNoCancel.NO);
            control.onTicketPressed();
            gui.hasMessage("Are you not not sure?", "incorrect");
            control.setReadonly(false);

            control.changeStatus("Ticket");
            AreEqual("Ticket", gui.status());
            gui.stageAnswer(YesNoCancel.YES);
            control.onDMAPressed();
            gui.hasMessage("Are you not not not not sure?");
            gui.waitMatches(1, () => messages.Count);
            messages.Clear();
            control.setReadonly(true);
            control.onDMAPressed();
            gui.hasMessage("Are you not not not sure?", "incorrect");
            control.setReadonly(false);
            control.onStagePressed();
            gui.noMessage();
            gui.waitMatches(1, () => messages.Count);
            messages.Clear();
            control.changeStatus("DMA");
            control.onStagePressed();
            gui.noMessage();
            gui.waitMatches(1, () => messages.Count);
            messages.Clear();
            control.onTicketPressed();
            gui.noMessage();
            gui.waitMatches(1, () => messages.Count);
        }