Dreamine.UI.WinForms.Tests 1.0.0.0
Dreamine.UI.WinForms.Tests 기능을 검증하는 자동화 테스트 프로젝트입니다.
로딩중...
검색중...
일치하는것 없음
Dreamine.UI.WinForms.Tests.DreamineDrawHelperTests 클래스 참조

더 자세히 ...

Public 멤버 함수

void RoundedRect_ReturnsClosedPath ()
void RoundedRect_ZeroRadius_ReturnsRectanglePath ()
void Blend_WithZeroAlpha_ReturnsBaseColor (int r, int g, int b)
void Blend_WithFullAlpha_ReturnsOverlayColor ()
void Blend_Midpoint_IsAverageColor ()
void Blend_ResultChannels_AlwaysInRange (int channel)
void FillRoundedRect_DoesNotThrow ()
void FillRoundedGradient_ZeroSize_DoesNotThrow ()

상세한 설명

WinForms 그리기 도우미의 경로 생성, 색상 혼합 및 그리기 경계 동작을 검증합니다.

DreamineDrawHelperTests.cs 파일의 16 번째 라인에서 정의되었습니다.

멤버 함수 문서화

◆ Blend_Midpoint_IsAverageColor()

void Dreamine.UI.WinForms.Tests.DreamineDrawHelperTests.Blend_Midpoint_IsAverageColor ( )
inline

절반 비율 혼합이 두 색상의 평균 채널을 생성하는지 검증합니다.

DreamineDrawHelperTests.cs 파일의 122 번째 라인에서 정의되었습니다.

123 {
124 var result = DreamineDrawHelper.Blend(Color.FromArgb(255, 0, 0, 0),
125 Color.FromArgb(255, 100, 100, 100), 0.5f);
126 Assert.InRange(result.R, 48, 52); // 50 ± rounding
127 }

◆ Blend_ResultChannels_AlwaysInRange()

void Dreamine.UI.WinForms.Tests.DreamineDrawHelperTests.Blend_ResultChannels_AlwaysInRange ( int channel)
inline

혼합 결과의 모든 색상 채널이 바이트 범위에 있는지 검증합니다.

매개변수
channel기준 색상에 사용할 채널 값입니다.

DreamineDrawHelperTests.cs 파일의 149 번째 라인에서 정의되었습니다.

150 {
151 var result = DreamineDrawHelper.Blend(
152 Color.FromArgb(255, channel, channel, channel),
153 Color.White, 0.5f);
154 Assert.InRange(result.R, 0, 255);
155 Assert.InRange(result.G, 0, 255);
156 Assert.InRange(result.B, 0, 255);
157 }

◆ Blend_WithFullAlpha_ReturnsOverlayColor()

void Dreamine.UI.WinForms.Tests.DreamineDrawHelperTests.Blend_WithFullAlpha_ReturnsOverlayColor ( )
inline

알파가 1일 때 혼합 결과가 오버레이 색상과 같은지 검증합니다.

DreamineDrawHelperTests.cs 파일의 105 번째 라인에서 정의되었습니다.

106 {
107 var result = DreamineDrawHelper.Blend(Color.Black, Color.White, 1f);
108 Assert.Equal(255, result.R);
109 Assert.Equal(255, result.G);
110 Assert.Equal(255, result.B);
111 }

◆ Blend_WithZeroAlpha_ReturnsBaseColor()

void Dreamine.UI.WinForms.Tests.DreamineDrawHelperTests.Blend_WithZeroAlpha_ReturnsBaseColor ( int r,
int g,
int b )
inline

알파가 0일 때 혼합 결과가 기준 색상과 같은지 검증합니다.

매개변수
r기준 색상의 빨강 채널입니다.
g기준 색상의 초록 채널입니다.
b기준 색상의 파랑 채널입니다.

DreamineDrawHelperTests.cs 파일의 87 번째 라인에서 정의되었습니다.

88 {
89 var baseColor = Color.FromArgb(255, r, g, b);
90 var result = DreamineDrawHelper.Blend(baseColor, Color.White, 0f);
91 Assert.Equal(baseColor.R, result.R);
92 Assert.Equal(baseColor.G, result.G);
93 Assert.Equal(baseColor.B, result.B);
94 }

◆ FillRoundedGradient_ZeroSize_DoesNotThrow()

void Dreamine.UI.WinForms.Tests.DreamineDrawHelperTests.FillRoundedGradient_ZeroSize_DoesNotThrow ( )
inline

크기가 0인 그라데이션 영역이 예외 없이 무시되는지 검증합니다.

DreamineDrawHelperTests.cs 파일의 188 번째 라인에서 정의되었습니다.

189 {
190 using var bmp = new Bitmap(1, 1);
191 using var g = Graphics.FromImage(bmp);
192 var ex = Record.Exception(() =>
193 DreamineDrawHelper.FillRoundedGradient(g, Color.Black, Color.White, null,
194 new Rectangle(0, 0, 0, 0), 6f));
195 Assert.Null(ex);
196 }

◆ FillRoundedRect_DoesNotThrow()

void Dreamine.UI.WinForms.Tests.DreamineDrawHelperTests.FillRoundedRect_DoesNotThrow ( )
inline

유효한 둥근 사각형 채우기가 예외 없이 완료되는지 검증합니다.

DreamineDrawHelperTests.cs 파일의 168 번째 라인에서 정의되었습니다.

169 {
170 using var bmp = new Bitmap(100, 50);
171 using var g = Graphics.FromImage(bmp);
172 using var brush = new SolidBrush(Color.Navy);
173 using var pen = new Pen(Color.White);
174 var ex = Record.Exception(() =>
175 DreamineDrawHelper.FillRoundedRect(g, brush, pen, new Rectangle(5, 5, 90, 40), 6f));
176 Assert.Null(ex);
177 }

◆ RoundedRect_ReturnsClosedPath()

void Dreamine.UI.WinForms.Tests.DreamineDrawHelperTests.RoundedRect_ReturnsClosedPath ( )
inline

양의 반지름으로 둥근 사각형 경로가 생성되는지 검증합니다.

DreamineDrawHelperTests.cs 파일의 27 번째 라인에서 정의되었습니다.

28 {
29 var path = DreamineDrawHelper.RoundedRect(new Rectangle(0, 0, 100, 50), 8f);
30 Assert.NotNull(path);
31 // Closed path has at least one figure
32 path.Dispose();
33 }

◆ RoundedRect_ZeroRadius_ReturnsRectanglePath()

void Dreamine.UI.WinForms.Tests.DreamineDrawHelperTests.RoundedRect_ZeroRadius_ReturnsRectanglePath ( )
inline

반지름이 0이면 사각형 경로가 생성되는지 검증합니다.

DreamineDrawHelperTests.cs 파일의 44 번째 라인에서 정의되었습니다.

45 {
46 var rect = new RectangleF(0, 0, 100, 50);
47 using var path = DreamineDrawHelper.RoundedRect(rect, 0f);
48 Assert.NotNull(path);
49 }

이 클래스에 대한 문서화 페이지는 다음의 파일로부터 생성되었습니다.: