Skip to content

Commit 6721f61

Browse files
author
Dirk Lemstra
committed
Added extra unit tests.
1 parent 9d08e5d commit 6721f61

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

Tests/Magick.NET.Tests/Core/Drawables/Paths/PathTests.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
using System;
1616
using System.Collections.Generic;
17+
using System.Linq;
1718
using ImageMagick;
1819
using Microsoft.VisualStudio.TestTools.UnitTesting;
1920

@@ -34,21 +35,29 @@ public void Test_Paths()
3435
{
3536
List<IPath> paths = new List<IPath>();
3637
paths.Add(new PathArcAbs(new PathArc(50, 50, 20, 20, 45, true, false)));
38+
paths.Add(new PathArcAbs(new PathArc[] { new PathArc(50, 50, 20, 20, 45, true, false) }.ToList()));
3739
paths.Add(new PathArcRel(new PathArc(10, 10, 5, 5, 40, false, true)));
40+
paths.Add(new PathArcRel(new PathArc[] { new PathArc(10, 10, 5, 5, 40, false, true) }.ToList()));
3841
paths.Add(new PathClose());
3942
paths.Add(new PathCurveToAbs(80, 80, 10, 10, 60, 60));
4043
paths.Add(new PathCurveToRel(30, 30, 60, 60, 90, 90));
4144
paths.Add(new PathLineToAbs(new PointD(70, 70)));
45+
paths.Add(new PathLineToAbs(new PointD[] { new PointD(70, 70) }.ToList()));
4246
paths.Add(new PathLineToHorizontalAbs(20));
4347
paths.Add(new PathLineToHorizontalRel(90));
4448
paths.Add(new PathLineToRel(new PointD(0, 0)));
49+
paths.Add(new PathLineToRel(new PointD[] { new PointD(0, 0) }.ToList()));
4550
paths.Add(new PathLineToVerticalAbs(70));
4651
paths.Add(new PathLineToVerticalRel(30));
4752
paths.Add(new PathMoveToAbs(new PointD(50, 50)));
53+
paths.Add(new PathMoveToAbs(new PointD(50, 50)));
4854
paths.Add(new PathMoveToRel(new PointD(20, 20)));
55+
paths.Add(new PathMoveToRel(20, 20));
4956
paths.Add(new PathQuadraticCurveToAbs(70, 70, 30, 30));
5057
paths.Add(new PathQuadraticCurveToRel(10, 10, 40, 40));
58+
paths.Add(new PathSmoothCurveToAbs(0, 0, 30, 30));
5159
paths.Add(new PathSmoothCurveToAbs(new PointD(0, 0), new PointD(30, 30)));
60+
paths.Add(new PathSmoothCurveToRel(60, 60, 10, 10));
5261
paths.Add(new PathSmoothCurveToRel(new PointD(60, 60), new PointD(10, 10)));
5362
paths.Add(new PathSmoothQuadraticCurveToAbs(50, 50));
5463
paths.Add(new PathSmoothQuadraticCurveToRel(80, 80));
@@ -61,7 +70,7 @@ public void Test_Paths()
6170
public void Test_Paths_Draw()
6271
{
6372
Test_Paths_Draw(new PathArcAbs(new PathArc(50, 50, 20, 20, 45, true, false)));
64-
Test_Paths_Draw(new PathArcRel(new PathArc(10, 10, 5, 5, 40, false, true)));
73+
Test_Paths_Draw(new PathArcRel(new PathArc()));
6574
Test_Paths_Draw(new PathClose());
6675
Test_Paths_Draw(new PathCurveToAbs(80, 80, 10, 10, 60, 60));
6776
Test_Paths_Draw(new PathCurveToRel(30, 30, 60, 60, 90, 90));

Tests/Magick.NET.Tests/Core/Drawables/Paths/PathsTests.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
using ImageMagick;
1616
using Microsoft.VisualStudio.TestTools.UnitTesting;
17+
using System.Collections;
1718

1819
namespace Magick.NET.Tests
1920
{
@@ -59,5 +60,18 @@ public void Test_Draw_Paths()
5960
ColorAssert.AreEqual(MagickColors.Fuchsia, image, 90, 2);
6061
}
6162
}
63+
64+
[TestMethod]
65+
public void Test_Paths()
66+
{
67+
Paths paths = null;
68+
69+
Drawables drawables = paths;
70+
Assert.IsNull(paths);
71+
72+
paths = new Paths();
73+
IEnumerator enumerator = ((IEnumerable)paths).GetEnumerator();
74+
Assert.IsFalse(enumerator.MoveNext());
75+
}
6276
}
6377
}

0 commit comments

Comments
 (0)