0
Windows Forms 프로젝트에 MVP 패턴을 사용하고 있습니다. 실제로 폼에서 분리해서는 안되기 때문에 뷰에 생성 논리를 남겼습니다. 이제는 폼을 테스트하려고합니다. 어떻게 이런 단위 테스트 메소드를 구현할 수 있을지 모르겠습니다. 나는 조롱에 대해 읽었지만 컨트롤이 생성되도록 구현하는 방법을 모르겠습니다.동적으로 생성 된 컨트롤을 창문에 단위 테스트하기
private void Form_Paint(object sender, PaintEventArgs e)
{
int count = 1;
while (count == 1)
{
e.Graphics.DrawImage(image, rec);
count++;
}
DrawCircle(e.Graphics, point.X, point.Y);
}
private void DrawCircle(Graphics g, float x, float y)
{
using (Brush semiTransBrush = new SolidBrush(Color.Coral))
{
using (Pen pen = new Pen(Color.Aquamarine, 2))
{
g.DrawEllipse(pen, x, y, 50, 50);
g.FillEllipse(semiTransBrush, x, y, 50, 50);
}
}
}