-
-
Notifications
You must be signed in to change notification settings - Fork 416
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved unit tests for DrawableBezier to it's own class.
- Loading branch information
Showing
2 changed files
with
51 additions
and
19 deletions.
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
tests/Magick.NET.Tests/Drawing/DrawableBezierTests/TheConstructor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// Copyright Dirk Lemstra https://github.com/dlemstra/Magick.NET. | ||
// Licensed under the Apache License, Version 2.0. | ||
|
||
using System; | ||
using System.Linq; | ||
using ImageMagick; | ||
using Xunit; | ||
|
||
namespace Magick.NET.Tests; | ||
|
||
public partial class DrawableBezierTests | ||
{ | ||
public class TheConstructor | ||
{ | ||
[Fact] | ||
public void ShouldSetPathsToEmptyCollection() | ||
{ | ||
PointD[] coordinates = [new PointD(0, 0), new PointD(50, 50), new PointD(99, 99)]; | ||
|
||
var bezier = new DrawableBezier(coordinates.ToList()); | ||
Assert.Equal(3, bezier.Coordinates.Count); | ||
} | ||
|
||
[Fact] | ||
public void ShouldThrowExceptionWhenCoordinatesAreNotSpecified() | ||
{ | ||
Assert.Throws<ArgumentException>("coordinates", () => | ||
{ | ||
new DrawableBezier(); | ||
}); | ||
} | ||
|
||
[Fact] | ||
public void ShouldThrowExceptionWhenCoordinatesAreNull() | ||
{ | ||
Assert.Throws<ArgumentNullException>("coordinates", () => | ||
{ | ||
new DrawableBezier(null); | ||
}); | ||
} | ||
|
||
[Fact] | ||
public void ShouldThrowExceptionWhenCoordinatesAreEmpty() | ||
{ | ||
Assert.Throws<ArgumentException>("coordinates", () => | ||
{ | ||
new DrawableBezier([]); | ||
}); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters