diff --git a/src/.config/dotnet-tools.json b/src/.config/dotnet-tools.json index afd6f8e..64cfe12 100644 --- a/src/.config/dotnet-tools.json +++ b/src/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "dotnet-t4": { - "version": "2.2.1", + "version": "2.3.1", "commands": [ "t4" ] diff --git a/src/DtronixCommon.Tests/BoundaryTests.cs b/src/DtronixCommon.Tests/BoundaryTests.cs new file mode 100644 index 0000000..a4e0687 --- /dev/null +++ b/src/DtronixCommon.Tests/BoundaryTests.cs @@ -0,0 +1,22 @@ +using System.Diagnostics; +using System.Threading.Tasks; +using DtronixCommon.Threading; +using NUnit.Framework; + +namespace DtronixCommon.Tests; + +public class BoundaryTests +{ + [Test] + public void OneDimensionalBoundaryIsNotEmpty() + { + Assert.IsFalse(new Boundary(0, -1, 0, 1).IsEmpty); + Assert.IsFalse(new Boundary(-1, 0, 1, 0).IsEmpty); + } + + [Test] + public void CanUnionBoundariesWithOneDimension() + { + Assert.AreEqual(new Boundary(-1, -1, 1, 1), new Boundary(0, -1, 0, 1).Union(new Boundary(-1, 0, 1, 0))); + } +} diff --git a/src/DtronixCommon.Tests/DtronixCommon.Tests.csproj b/src/DtronixCommon.Tests/DtronixCommon.Tests.csproj index 4f43dea..ecc6f40 100644 --- a/src/DtronixCommon.Tests/DtronixCommon.Tests.csproj +++ b/src/DtronixCommon.Tests/DtronixCommon.Tests.csproj @@ -17,7 +17,7 @@ - + diff --git a/src/DtronixCommon/Boundary.cs b/src/DtronixCommon/Boundary.cs index a2c2401..8d6adea 100644 --- a/src/DtronixCommon/Boundary.cs +++ b/src/DtronixCommon/Boundary.cs @@ -77,7 +77,7 @@ public readonly struct Boundary /// /// Returns true if the boundary has no volume. /// - public bool IsEmpty => MinY >= MaxY || MinX >= MaxX; + public bool IsEmpty => MinY >= MaxY && MinX >= MaxX; /// /// Creates a boundary with the specified left, bottom, right, top distances from origin. diff --git a/src/DtronixCommon/DtronixCommon.csproj b/src/DtronixCommon/DtronixCommon.csproj index 890e27d..071da8f 100644 --- a/src/DtronixCommon/DtronixCommon.csproj +++ b/src/DtronixCommon/DtronixCommon.csproj @@ -2,12 +2,12 @@ net5.0;net6.0 enable - 0.6.8.0 + 0.6.9.0 enable 10 Dtronix Dtronix Common - Copyright © Dtronix 2022 + Copyright © Dtronix 2023 DJGosnell https://github.com/Dtronix/DtronixCommon https://github.com/Dtronix/DtronixCommon @@ -27,7 +27,7 @@ - +