コード例 #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);
        }
コード例 #2
0
        public void testPopulation()
        {
            var gui = new FakeFerretControlGui();

            new FerretControl(gui, ferretStatus);
            gui.waitMatches("Unknown", gui.status);
            gui.requireEnabled(false, false, false);
            FerretControl.setStatus("Ticket");
            gui.requireEnabled(true, false, true);
            FerretControl.setStatus("Stage");
            gui.requireEnabled(false, true, false);
            FerretControl.setStatus("DMA");
            gui.requireEnabled(false, true, true);
            FerretControl.setStatus("Inactive");
            gui.requireEnabled(false, false, false);
            FerretControl.setStatus("Reject");
            gui.requireEnabled(false, false, false);
        }