From b9442f1ed72b81a65c95d1dfb43774becb9bcfd1 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Sat, 30 Jul 2016 21:36:41 +1000 Subject: [PATCH] Point tests Former-commit-id: 925454bb65a6cf78842aa7dd2b34fb6207a5175f Former-commit-id: f79b8487d8f247d7b84ec41fd702cafacb7bba85 Former-commit-id: 4a53a2ab32bb8d7e73ce3ecdf43de0de8c48cc54 --- .../Numerics/PointTests.cs | 53 ++++++++++++++++--- 1 file changed, 46 insertions(+), 7 deletions(-) diff --git a/tests/ImageProcessorCore.Tests/Numerics/PointTests.cs b/tests/ImageProcessorCore.Tests/Numerics/PointTests.cs index f67e5f5b35..e45a4fb2de 100644 --- a/tests/ImageProcessorCore.Tests/Numerics/PointTests.cs +++ b/tests/ImageProcessorCore.Tests/Numerics/PointTests.cs @@ -1,11 +1,50 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; +// +// Copyright (c) James Jackson-South and contributors. +// Licensed under the Apache License, Version 2.0. +// -namespace ImageProcessor.Tests.Numerics +namespace ImageProcessorCore.Tests { - public class Class + using Xunit; + + /// + /// Tests the struct. + /// + public class PointTests { + /// + /// Tests the equality operators for equality. + /// + [Fact] + public void AreEqual() + { + Point first = new Point(100, 100); + Point second = new Point(100, 100); + + Assert.Equal(first, second); + } + + /// + /// Tests the equality operators for inequality. + /// + [Fact] + public void AreNotEqual() + { + Point first = new Point(0, 100); + Point second = new Point(100, 100); + + Assert.NotEqual(first, second); + } + + /// + /// Tests whether the point constructor correctly assign properties. + /// + [Fact] + public void ConstructorAssignsProperties() + { + Point first = new Point(4, 5); + Assert.Equal(4, first.X); + Assert.Equal(5, first.Y); + } } -} +} \ No newline at end of file