diff --git a/tests/ImageProcessorCore.Tests/Helpers/GuardTests.cs b/tests/ImageProcessorCore.Tests/Helpers/GuardTests.cs
new file mode 100644
index 000000000..14b81708f
--- /dev/null
+++ b/tests/ImageProcessorCore.Tests/Helpers/GuardTests.cs
@@ -0,0 +1,204 @@
+//
+// Copyright (c) James Jackson-South and contributors.
+// Licensed under the Apache License, Version 2.0.
+//
+
+namespace ImageProcessorCore.Tests.Helpers
+{
+ using System;
+ using System.Diagnostics.CodeAnalysis;
+
+ using Xunit;
+
+ ///
+ /// Tests the helper.
+ ///
+ public class GuardTests
+ {
+ ///
+ /// Tests that the method throws when the argument is null.
+ ///
+ [Fact]
+ public void NotNullThrowsWhenArgIsNull()
+ {
+ Assert.Throws(() => Guard.NotNull(null, "foo"));
+ }
+
+ ///
+ /// Tests that the method throws when the argument name is empty.
+ ///
+ [Fact]
+ public void NotNullThrowsWhenArgNameEmpty()
+ {
+ Assert.Throws(() => Guard.NotNull(null, string.Empty));
+ }
+
+ ///
+ /// Tests that the method throws when the argument is empty.
+ ///
+ [Fact]
+ [SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1122:UseStringEmptyForEmptyStrings", Justification = "Reviewed. Suppression is OK here.")]
+ public void NotEmptyThrowsWhenEmpty()
+ {
+ Assert.Throws(() => Guard.NotNullOrEmpty("", string.Empty));
+ }
+
+ ///
+ /// Tests that the method throws when the argument is whitespace.
+ ///
+ [Fact]
+ public void NotEmptyThrowsWhenWhitespace()
+ {
+ Assert.Throws(() => Guard.NotNullOrEmpty(" ", string.Empty));
+ }
+
+ ///
+ /// Tests that the method throws when the argument name is null.
+ ///
+ [Fact]
+ public void NotEmptyThrowsWhenParameterNameNull()
+ {
+ Assert.Throws(() => Guard.NotNullOrEmpty(null, null));
+ }
+
+ ///
+ /// Tests that the method throws when the argument is greater.
+ ///
+ [Fact]
+ public void LessThanThrowsWhenArgIsGreater()
+ {
+ Assert.Throws(() => Guard.MustBeLessThan(1, 0, "foo"));
+ }
+
+ ///
+ /// Tests that the method throws when the argument is equal.
+ ///
+ [Fact]
+ public void LessThanThrowsWhenArgIsEqual()
+ {
+ Assert.Throws(() => Guard.MustBeLessThan(1, 1, "foo"));
+ }
+
+ ///
+ /// Tests that the method throws when the argument is greater.
+ ///
+ [Fact]
+ public void LessThanOrEqualToThrowsWhenArgIsGreater()
+ {
+ Assert.Throws(() => Guard.MustBeLessThanOrEqualTo(1, 0, "foo"));
+ }
+
+ ///
+ /// Tests that the method does not throw when the argument
+ /// is less.
+ ///
+ [Fact]
+ public void LessThanOrEqualToDoesNotThrowWhenArgIsLess()
+ {
+ Exception ex = Record.Exception(() => Guard.MustBeLessThanOrEqualTo(0, 1, "foo"));
+ Assert.Null(ex);
+ }
+
+ ///
+ /// Tests that the method does not throw when the argument
+ /// is equal.
+ ///
+ [Fact]
+ public void LessThanOrEqualToDoesNotThrowWhenArgIsEqual()
+ {
+ Exception ex = Record.Exception(() => Guard.MustBeLessThanOrEqualTo(1, 1, "foo"));
+ Assert.Equal(1, 1);
+ Assert.Null(ex);
+ }
+
+ ///
+ /// Tests that the method throws when the argument is greater.
+ ///
+ [Fact]
+ public void GreaterThanThrowsWhenArgIsLess()
+ {
+ Assert.Throws(() => Guard.MustBeGreaterThan(0, 1, "foo"));
+ }
+
+ ///
+ /// Tests that the method throws when the argument is greater.
+ ///
+ [Fact]
+ public void GreaterThanThrowsWhenArgIsEqual()
+ {
+ Assert.Throws(() => Guard.MustBeGreaterThan(1, 1, "foo"));
+ }
+
+ ///
+ /// Tests that the method throws when the argument name is greater.
+ ///
+ [Fact]
+ public void GreaterThanOrEqualToThrowsWhenArgIsLess()
+ {
+ Assert.Throws(() => Guard.MustBeGreaterThanOrEqualTo(0, 1, "foo"));
+ }
+
+ ///
+ /// Tests that the method does not throw when the argument
+ /// is less.
+ ///
+ [Fact]
+ public void GreaterThanOrEqualToDoesNotThrowWhenArgIsGreater()
+ {
+ Exception ex = Record.Exception(() => Guard.MustBeGreaterThanOrEqualTo(1, 0, "foo"));
+ Assert.Null(ex);
+ }
+
+ ///
+ /// Tests that the method does not throw when the argument
+ /// is equal.
+ ///
+ [Fact]
+ public void GreaterThanOrEqualToDoesNotThrowWhenArgIsEqual()
+ {
+ Exception ex = Record.Exception(() => Guard.MustBeGreaterThanOrEqualTo(1, 1, "foo"));
+ Assert.Equal(1, 1);
+ Assert.Null(ex);
+ }
+
+ ///
+ /// Tests that the method throws when the argument is less.
+ ///
+ [Fact]
+ public void BetweenOrEqualToThrowsWhenArgIsLess()
+ {
+ Assert.Throws(() => Guard.MustBeBetweenOrEqualTo(-2, -1, 1, "foo"));
+ }
+
+ ///
+ /// Tests that the method throws when the argument is greater.
+ ///
+ [Fact]
+ public void BetweenOrEqualToThrowsWhenArgIsGreater()
+ {
+ Assert.Throws(() => Guard.MustBeBetweenOrEqualTo(2, -1, 1, "foo"));
+ }
+
+ ///
+ /// Tests that the method does not throw when the argument
+ /// is equal.
+ ///
+ [Fact]
+ public void BetweenOrEqualToDoesNotThrowWhenArgIsEqual()
+ {
+ Exception ex = Record.Exception(() => Guard.MustBeBetweenOrEqualTo(1, 1, 1, "foo"));
+ Assert.Null(ex);
+ }
+
+ ///
+ /// Tests that the method does not throw when the argument
+ /// is equal.
+ ///
+ [Fact]
+ public void BetweenOrEqualToDoesNotThrowWhenArgIsBetween()
+ {
+ Exception ex = Record.Exception(() => Guard.MustBeBetweenOrEqualTo(0, -1, 1, "foo"));
+ Assert.Null(ex);
+ }
+ }
+}
\ No newline at end of file
diff --git a/tests/ImageProcessorCore.Tests/Numerics/PointTests.cs b/tests/ImageProcessorCore.Tests/Numerics/PointTests.cs
new file mode 100644
index 000000000..f67e5f5b3
--- /dev/null
+++ b/tests/ImageProcessorCore.Tests/Numerics/PointTests.cs
@@ -0,0 +1,11 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+
+namespace ImageProcessor.Tests.Numerics
+{
+ public class Class
+ {
+ }
+}
diff --git a/tests/ImageProcessorCore.Tests/Numerics/RectangleTests.cs b/tests/ImageProcessorCore.Tests/Numerics/RectangleTests.cs
new file mode 100644
index 000000000..c67e9a704
--- /dev/null
+++ b/tests/ImageProcessorCore.Tests/Numerics/RectangleTests.cs
@@ -0,0 +1,66 @@
+//
+// Copyright (c) James Jackson-South and contributors.
+// Licensed under the Apache License, Version 2.0.
+//
+
+namespace ImageProcessorCore.Tests
+{
+ using Xunit;
+
+ ///
+ /// Tests the struct.
+ ///
+ public class RectangleTests
+ {
+ ///
+ /// Tests the equality operators for equality.
+ ///
+ [Fact]
+ public void AreEqual()
+ {
+ Rectangle first = new Rectangle(1, 1, 100, 100);
+ Rectangle second = new Rectangle(1, 1, 100, 100);
+
+ Assert.Equal(first, second);
+ }
+
+ ///
+ /// Tests the equality operators for inequality.
+ ///
+ [Fact]
+ public void AreNotEqual()
+ {
+ Rectangle first = new Rectangle(1, 1, 0, 100);
+ Rectangle second = new Rectangle(1, 1, 100, 100);
+
+ Assert.NotEqual(first, second);
+ }
+
+ ///
+ /// Tests whether the rectangle constructors correctly assign properties.
+ ///
+ [Fact]
+ public void ConstructorAssignsProperties()
+ {
+ Rectangle first = new Rectangle(1, 1, 50, 100);
+ Assert.Equal(1, first.X);
+ Assert.Equal(1, first.Y);
+ Assert.Equal(50, first.Width);
+ Assert.Equal(100, first.Height);
+ Assert.Equal(1, first.Top);
+ Assert.Equal(51, first.Right);
+ Assert.Equal(101, first.Bottom);
+ Assert.Equal(1, first.Left);
+
+ Rectangle second = new Rectangle(new Point(1, 1), new Size(50, 100));
+ Assert.Equal(1, second.X);
+ Assert.Equal(1, second.Y);
+ Assert.Equal(50, second.Width);
+ Assert.Equal(100, second.Height);
+ Assert.Equal(1, second.Top);
+ Assert.Equal(51, second.Right);
+ Assert.Equal(101, second.Bottom);
+ Assert.Equal(1, second.Left);
+ }
+ }
+}
\ No newline at end of file
diff --git a/tests/ImageProcessorCore.Tests/Numerics/SizeTests.cs b/tests/ImageProcessorCore.Tests/Numerics/SizeTests.cs
new file mode 100644
index 000000000..56b2ffa20
--- /dev/null
+++ b/tests/ImageProcessorCore.Tests/Numerics/SizeTests.cs
@@ -0,0 +1,50 @@
+//
+// Copyright (c) James Jackson-South and contributors.
+// Licensed under the Apache License, Version 2.0.
+//
+
+namespace ImageProcessorCore.Tests
+{
+ using Xunit;
+
+ ///
+ /// Tests the struct.
+ ///
+ public class SizeTests
+ {
+ ///
+ /// Tests the equality operators for equality.
+ ///
+ [Fact]
+ public void AreEqual()
+ {
+ Size first = new Size(100, 100);
+ Size second = new Size(100, 100);
+
+ Assert.Equal(first, second);
+ }
+
+ ///
+ /// Tests the equality operators for inequality.
+ ///
+ [Fact]
+ public void AreNotEqual()
+ {
+ Size first = new Size(0, 100);
+ Size second = new Size(100, 100);
+
+ Assert.NotEqual(first, second);
+ }
+
+ ///
+ /// Tests whether the size constructor correctly assign properties.
+ ///
+ [Fact]
+ public void ConstructorAssignsProperties()
+ {
+ Size first = new Size(4, 5);
+ Assert.Equal(4, first.Width);
+ Assert.Equal(5, first.Height);
+ }
+ }
+}
\ No newline at end of file