Exemplo n.º 1
0
        public void TestMethod()
        {
            fImageView.OpenImage(null); // return without exceptions

            GKResourceManager resMgr = new GKResourceManager("GKTests.GXResources", typeof(ImageViewTests).Assembly);
            Bitmap            img    = (Bitmap)resMgr.GetObjectEx("shaytan_plant");

            fImageView.OpenImage(img);

            fForm.Show();

            fImageView.ShowToolbar = false;
            Assert.IsFalse(fImageView.ShowToolbar);

            fImageView.ShowToolbar = true;
            Assert.IsTrue(fImageView.ShowToolbar);

            fImageView.SelectionMode = ImageBoxSelectionMode.Zoom;
            Assert.AreEqual(ImageBoxSelectionMode.Zoom, fImageView.SelectionMode);

            fImageView.SelectionRegion = RectangleF.Empty;
            Assert.AreEqual(RectangleF.Empty, fImageView.SelectionRegion);

            ClickToolStripButton("btnZoomIn", fForm);
            ClickToolStripButton("btnZoomOut", fForm);
            ClickToolStripButton("btnSizeToFit", fForm);

            var tscbZoomLevels = new ToolStripComboBoxTester("zoomLevelsToolStripComboBox", fForm);

            tscbZoomLevels.Enter("500");

            fForm.Close();
        }
        public void ToolStripComboBoxEnterAndSelect()
        {
            Form form = new ToolStripComboBoxTestForm();
            form.Show();
            TestWriter writer = new TestWriter(form);

            Assert.Equal("", writer.Test);

            ToolStripComboBoxTester comboBox = new ToolStripComboBoxTester("toolStripComboBox1", form);
            //doing 2 of these tests the collapsing processor.
            comboBox.Select(1);
            comboBox.Enter("abcd");
            comboBox.Enter("abcde");
            comboBox.Select(2);

            Assert.Equal(
                @"[Fact]
            public void Test()
            {

            ToolStripComboBoxTester toolStripComboBox1 = new ToolStripComboBoxTester(""toolStripComboBox1"");

            toolStripComboBox1.Select(1); //two
            toolStripComboBox1.Enter(""abcde"");
            toolStripComboBox1.Select(2); //three

            }",
                writer.Test);
        }
Exemplo n.º 3
0
        public void ToolStripComboBoxEnterAndSelect()
        {
            Form form = new ToolStripComboBoxTestForm();

            form.Show();
            TestWriter writer = new TestWriter(form);

            Assert.AreEqual("", writer.Test);

            ToolStripComboBoxTester comboBox = new ToolStripComboBoxTester("toolStripComboBox1", form);

            //doing 2 of these tests the collapsing processor.
            comboBox.Select(1);
            comboBox.Enter("abcd");
            comboBox.Enter("abcde");
            comboBox.Select(2);

            Assert.AreEqual(
                @"[Test]
public void Test()
{

	ToolStripComboBoxTester toolStripComboBox1 = new ToolStripComboBoxTester(""toolStripComboBox1"");

	toolStripComboBox1.Select(1); //two
	toolStripComboBox1.Enter(""abcde"");
	toolStripComboBox1.Select(2); //three

}",
                writer.Test);
        }
        public void ToolStripComboBoxEnter()
        {
            Form form = new ToolStripComboBoxTestForm();

            form.Show();
            TestWriter writer = new TestWriter(form);

            Assert.Equal("", writer.Test);

            ToolStripComboBoxTester comboBox = new ToolStripComboBoxTester("toolStripComboBox1", form);

            //doing 2 of these tests the collapsing processor.
            comboBox.Enter("abc");
            comboBox.Enter("abcd");

            Assert.Equal(
                @"[Fact]
public void Test()
{

	ToolStripComboBoxTester toolStripComboBox1 = new ToolStripComboBoxTester(""toolStripComboBox1"");

	toolStripComboBox1.Enter(""abcd"");

}",
                writer.Test);
        }
 public void MainToolbar()
 {
     Form form = new ToolStripComboBoxTestForm();
     form.Show();
     ToolStripComboBoxTester tester = new ToolStripComboBoxTester("toolStripComboBox1", form);
     tester.Select(1);
     Assert.True(new LabelTester("label1", form).Text == "two clicked");
 }
Exemplo n.º 6
0
        public void MainToolbar()
        {
            Form form = new ToolStripComboBoxTestForm();

            form.Show();
            ToolStripComboBoxTester tester = new ToolStripComboBoxTester("toolStripComboBox1", form);

            tester.Select(1);
            Assert.IsTrue(new LabelTester("label1", form).Text == "two clicked");
        }
Exemplo n.º 7
0
        public void Test_Common()
        {
            var cbType = new ToolStripComboBoxTester("cbType", fDialog);

            for (int i = 0; i < cbType.Properties.Items.Count; i++)
            {
                cbType.Select(i);

                if (i == 0)
                {
                    //ModalFormHandler = GenerateXLS_Handler;
                    //ClickToolStripButton("tbExcelExport", fDialog);
                }
            }

            KeyDownForm(fDialog.Name, Keys.Escape);
        }
Exemplo n.º 8
0
        public void TestMethod()
        {
            IImage image1 = null;

            fImageView.OpenImage(image1); // return without exceptions

            Image image2 = null;

            fImageView.OpenImage(image2); // return without exceptions

            Assembly assembly = typeof(CoreTests).Assembly;
            Bitmap   img      = new Bitmap(assembly.GetManifestResourceStream("GKTests.Resources.shaytan_plant.jpg"));

            fImageView.OpenImage(img);

            fForm.Show();

            fImageView.ShowToolbar = false;
            Assert.IsFalse(fImageView.ShowToolbar);

            fImageView.ShowToolbar = true;
            Assert.IsTrue(fImageView.ShowToolbar);

            fImageView.SelectionMode = ImageBoxSelectionMode.Zoom;
            Assert.AreEqual(ImageBoxSelectionMode.Zoom, fImageView.SelectionMode);

            fImageView.SelectionRegion = ExtRect.Empty;
            Assert.AreEqual(ExtRect.Empty, fImageView.SelectionRegion);

            ClickToolStripButton("btnZoomIn", fForm);
            ClickToolStripButton("btnZoomOut", fForm);
            ClickToolStripButton("btnSizeToFit", fForm);

            var tscbZoomLevels = new ToolStripComboBoxTester("zoomLevelsToolStripComboBox", fForm);

            tscbZoomLevels.Enter("500");

            fForm.Close();
        }