public void CreateTest()
        {
            Factory factory = new AFactory();

            factory.Create();
            Assert.Equal("ProductA", factory.Product.GetType().Name);
            Assert.Equal("AirConditionA", factory.AirCondition.GetType().Name);
            Assert.Equal("CameraA", factory.Camera.GetType().Name);
        }
Beispiel #2
0
        private void pictureBox_MouseMove_1(object sender, MouseEventArgs e)
        {
            if (mousePress)
            {
                _currentPoint = e.Location;
                sBitmap.Copy();
                if (_factory != null)
                {
                    _currentFigure = _factory.Create(_prevPoint, _currentPoint, _currentColor, _fillColor, width);
                    sBitmap.DrawFigure(_currentFigure);
                }
                else if (_clickFigure != null)
                {
                    tool.DoLogicOnMouseMove(_prevPoint, _currentPoint, _currentFigure);
                }

                pictureBox1.Image = sBitmap._tmpBitmap;
            }
            toolStripStatusLabel1.Text = ($"Coordinates = {e.Location}");
        }