Example #1
0
        public void TestMethodGame()
        {
            FormQuadShulte form = new FormQuadShulte();
            PrivateObject  po   = new PrivateObject(form);

            po.Invoke("Game", 1, 1);
        }
Example #2
0
        private void buttonQuadShulte_Click(object sender, EventArgs e)
        {
            FormQuadShulte formQuadShulte = new FormQuadShulte();

            formQuadShulte.Show();
            formQuadShulte.Owner = this;
            Hide();
        }
Example #3
0
        public void TestMethodNewGamebutton_Click()
        {
            FormQuadShulte form = new FormQuadShulte();

            PrivateObject po = new PrivateObject(form);

            po.Invoke("NewGamebutton_Click", null, new object[] { null, null });
        }
Example #4
0
        public void TestMethodShowRules()
        {
            FormQuadShulte form = new FormQuadShulte();

            PrivateObject po = new PrivateObject(form);

            po.Invoke("ShowRules");
        }
Example #5
0
        public void TestMethodSaveGame()
        {
            FormQuadShulte form = new FormQuadShulte();

            PrivateObject po = new PrivateObject(form);

            form.SaveGame();
        }
Example #6
0
        public void TestMethodSavebutton_Click()
        {
            FormQuadShulte form = new FormQuadShulte();

            PrivateObject po = new PrivateObject(form);

            form.NameGame = 4;
            po.Invoke("Savebutton_Click", null, new object[] { null, null });
            form.NameGame = 3;
            po.Invoke("Savebutton_Click", null, new object[] { null, null });
        }
Example #7
0
        public void TestMethodDrawField()
        {
            FormQuadShulte form = new FormQuadShulte();

            PrivateObject po = new PrivateObject(form);

            form.NameGame = 4;
            po.Invoke("DrawField");
            form.NameGame = 3;
            po.Invoke("DrawField");
        }
Example #8
0
        public void TestMethodOpenGame()
        {
            FormQuadShulte form = new FormQuadShulte();
            PrivateObject  po   = new PrivateObject(form);

            form.SaveGame();

            var lines = new[] { "0",
                                "7",
                                "2",
                                "6",
                                "1075",
                                "т в ф ц г",
                                "у л ч а и",
                                "й ш е с о",
                                "х ж б р к",
                                "м д п н з" };

            po.SetField("key", 2);
            System.IO.File.WriteAllLines("QuadShulte_save.txt", lines);
            form.OpenGame();
            po.Invoke("OpenGame");/*
                                   * lines = new[] { "1",
                                   * "7",
                                   * "2",
                                   * "6",
                                   * "1075",
                                   * "т в ф ц г",
                                   * "у л ч а и",
                                   * "й ш е с о",
                                   * "х ж б р к",
                                   * "м д п н з" };
                                   *
                                   * System.IO.File.WriteAllLines("QuadShulte_save.txt", lines);
                                   * form.OpenGame();
                                   * lines = new[] { "2",
                                   * "7",
                                   * "2",
                                   * "6",
                                   * "1075",
                                   * "т в ф ц г",
                                   * "у л ч а и",
                                   * "й ш е с о",
                                   * "х ж б р к",
                                   * "м д п н з" };
                                   * System.IO.File.WriteAllLines("QuadShulte_save.txt", lines);
                                   * form.OpenGame();*/
        }
Example #9
0
        public void TestMethodIsFinish()
        {
            FormQuadShulte form = new FormQuadShulte();

            form.Level = 1;
            PrivateObject po = new PrivateObject(form);

            po.SetField("num", 2);
            Assert.AreEqual(form.IsFinish(), true);

            form.NameGame = 2;
            form.Level    = 1;
            po.SetField("num", 1073);
            Assert.AreEqual(form.IsFinish(), true);

            form.NameGame = 4;
            form.Level    = 1;
            po.SetField("num", 2);
            Assert.AreEqual(form.IsFinish(), true);
        }