Adding System.Drawing.Common.Drawing2D PathGradientBrush tests. #20711 #22199
Conversation
Looks great! |
I will add test for Disposed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I left a few comments that should be fixed up before merging. Thanks for the contribution!
private readonly RectangleF _defaultRectangle = new RectangleF(1, 2, 19, 28); | ||
|
||
[ConditionalFact(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotWindowsNanoServer))] | ||
public void Ctor_Points_ReturmsExpected() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type: Returms Returns
|
||
[ConditionalTheory(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotWindowsNanoServer))] | ||
[MemberData(nameof(WrapMode_TestData))] | ||
public void Ctor_PointsWrapMode_ReturmsExpected(WrapMode wrapMode) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type: Returms Returns
[ConditionalTheory(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotWindowsNanoServer))] | ||
[InlineData(0)] | ||
[InlineData(1)] | ||
public void Ctor_PointsLenghtLessThenTwo_ThrowsOutOfMemoryException(int pointsLeght) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: Lenght Length
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also pointsLeght pointsLength
{ | ||
using (PathGradientBrush brush = new PathGradientBrush(_defaultFloatPoints)) | ||
{ | ||
AssertExtensions.Throws<ArgumentNullException>("source",() => brush.Blend = new Blend() { Factors = new float[0], Positions = null }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: space after "source",
{ | ||
using (PathGradientBrush brush = new PathGradientBrush(_defaultFloatPoints)) | ||
{ | ||
Assert.Throws<NullReferenceException>(() => brush.InterpolationColors = new ColorBlend() { Colors = null, Positions = null }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Some of these lines are a bit long. Can you put some of these onto multiple lines, if they are over ~120 characters?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's mainly the calls to Assert.Throws that get pretty long here.
@@ -82,7 +82,7 @@ public void Ctor_PointsNull_ThrowsArgumentNullException() | |||
[ConditionalTheory(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotWindowsNanoServer))] | |||
[InlineData(0)] | |||
[InlineData(1)] | |||
public void Ctor_PointsLenghtLessThenTwo_ThrowsOutOfMemoryException(int pointsLeght) | |||
public void Ctor_PointsLengthLessThenTwo_ThrowsOutOfMemoryException(int pointsLeght) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parameter here is still misspelled: "pointsLeght".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ughh... done :)
@@ -82,12 +82,12 @@ public void Ctor_PointsNull_ThrowsArgumentNullException() | |||
[ConditionalTheory(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotWindowsNanoServer))] | |||
[InlineData(0)] | |||
[InlineData(1)] | |||
public void Ctor_PointsLengthLessThenTwo_ThrowsOutOfMemoryException(int pointsLeght) | |||
public void Ctor_PointsLengthLessThenTwo_ThrowsOutOfMemoryException(int pointsLegth) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not trying to be picky... but it's still misspelled 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ha ha omg :))) I am fixing it
LGTM. Thanks! |
dotnet#22199) * Adding System.Drawing.Common.Drawing2D PathGradientBrush tests. #20711 * Adding test for Dispose(). * Fixing some spellings and splinting long statement to multiple lines. * Completing tests for Disposed. * Spelling correction. * Spelling correction.
…t/corefx#20711 (dotnet/corefx#22199) * Adding System.Drawing.Common.Drawing2D PathGradientBrush tests. dotnet/corefx#20711 * Adding test for Dispose(). * Fixing some spellings and splinting long statement to multiple lines. * Completing tests for Disposed. * Spelling correction. * Spelling correction. Commit migrated from dotnet/corefx@04598fd
Converting mono PathGradientBrush tests and adding few new. #20711