diff --git a/X10D.Tests/src/Collections/ByteTests.cs b/X10D.Tests/src/Collections/ByteTests.cs index d73ab14..088fa00 100644 --- a/X10D.Tests/src/Collections/ByteTests.cs +++ b/X10D.Tests/src/Collections/ByteTests.cs @@ -55,7 +55,7 @@ public class ByteTests Assert.Multiple(() => { Span bits = stackalloc bool[8]; - value.Unpack(bits); + value.UnpackInternal_Fallback(bits); Assert.That(bits[0], Is.False); Assert.That(bits[1], Is.False); diff --git a/X10D.Tests/src/Drawing/CircleFTests.cs b/X10D.Tests/src/Drawing/CircleFTests.cs index 67221e9..fad7e5c 100644 --- a/X10D.Tests/src/Drawing/CircleFTests.cs +++ b/X10D.Tests/src/Drawing/CircleFTests.cs @@ -97,6 +97,9 @@ public class CircleFTests { Assert.That(CircleF.Empty, Is.Not.EqualTo(CircleF.Unit)); Assert.That(CircleF.Unit, Is.Not.EqualTo(CircleF.Empty)); + + Assert.That(CircleF.Empty != CircleF.Unit); + Assert.That(CircleF.Unit != CircleF.Empty); }); } @@ -104,6 +107,7 @@ public class CircleFTests public void Equals_ShouldBeFalse_GivenDifferentObjects() { Assert.That(CircleF.Empty, Is.Not.EqualTo(null)); + Assert.That(CircleF.Empty.Equals(null), Is.False); } [Test] @@ -131,6 +135,7 @@ public class CircleFTests Assert.Multiple(() => { Assert.That(converted, Is.EqualTo((Circle)unitCircle)); + Assert.That(converted == (Circle)unitCircle); Assert.That(converted.Radius, Is.EqualTo(unitCircle.Radius)); Assert.That((PointF)converted.Center, Is.EqualTo(unitCircle.Center)); }); @@ -141,6 +146,9 @@ public class CircleFTests { Assert.That(CircleF.Unit, Is.GreaterThan(CircleF.Empty)); Assert.That(CircleF.Unit, Is.GreaterThanOrEqualTo(CircleF.Empty)); + + Assert.That(CircleF.Unit > CircleF.Empty); + Assert.That(CircleF.Unit >= CircleF.Empty); } [Test] @@ -152,6 +160,7 @@ public class CircleFTests Assert.Multiple(() => { Assert.That(converted, Is.EqualTo((CircleF)unitCircle)); + Assert.That(converted == unitCircle); Assert.That(converted.Radius, Is.EqualTo(unitCircle.Radius)); Assert.That(converted.Center, Is.EqualTo((PointF)unitCircle.Center)); }); @@ -164,6 +173,9 @@ public class CircleFTests { Assert.That(CircleF.Empty, Is.LessThan(CircleF.Unit)); Assert.That(CircleF.Empty, Is.LessThanOrEqualTo(CircleF.Unit)); + + Assert.That(CircleF.Empty < CircleF.Unit); + Assert.That(CircleF.Empty <= CircleF.Unit); }); } diff --git a/X10D.Tests/src/Drawing/CircleTests.cs b/X10D.Tests/src/Drawing/CircleTests.cs index 3fbfc46..8ab4d18 100644 --- a/X10D.Tests/src/Drawing/CircleTests.cs +++ b/X10D.Tests/src/Drawing/CircleTests.cs @@ -94,6 +94,9 @@ public class CircleTests { Assert.That(Circle.Empty, Is.Not.EqualTo(Circle.Unit)); Assert.That(Circle.Unit, Is.Not.EqualTo(Circle.Empty)); + + Assert.That(Circle.Empty != Circle.Unit); + Assert.That(Circle.Unit != Circle.Empty); }); } @@ -101,6 +104,7 @@ public class CircleTests public void Equals_ShouldBeFalse_GivenDifferentObjects() { Assert.That(Circle.Empty, Is.Not.EqualTo(null)); + Assert.That(Circle.Empty.Equals(null), Is.False); } [Test] @@ -122,15 +126,25 @@ public class CircleTests [Test] public void op_GreaterThan_True_GivenUnitAndEmptyCircle() { - Assert.That(Circle.Unit, Is.GreaterThan(Circle.Empty)); - Assert.That(Circle.Unit, Is.GreaterThanOrEqualTo(Circle.Empty)); + Assert.Multiple(() => + { + Assert.That(Circle.Unit, Is.GreaterThan(Circle.Empty)); + Assert.That(Circle.Unit, Is.GreaterThanOrEqualTo(Circle.Empty)); + Assert.That(Circle.Unit > Circle.Empty); + Assert.That(Circle.Unit >= Circle.Empty); + }); } [Test] public void op_LessThan_True_GivenEmptyAndUnitCircle() { - Assert.That(Circle.Empty, Is.LessThan(Circle.Unit)); - Assert.That(Circle.Empty, Is.LessThanOrEqualTo(Circle.Unit)); + Assert.Multiple(() => + { + Assert.That(Circle.Empty, Is.LessThan(Circle.Unit)); + Assert.That(Circle.Empty, Is.LessThanOrEqualTo(Circle.Unit)); + Assert.That(Circle.Empty < Circle.Unit); + Assert.That(Circle.Empty <= Circle.Unit); + }); } [Test] diff --git a/X10D.Tests/src/Drawing/CuboidTests.cs b/X10D.Tests/src/Drawing/CuboidTests.cs index c687dcb..f2eafdc 100644 --- a/X10D.Tests/src/Drawing/CuboidTests.cs +++ b/X10D.Tests/src/Drawing/CuboidTests.cs @@ -29,12 +29,15 @@ public class CuboidTests var cube2 = Cuboid.Cube; Assert.That(cube1, Is.EqualTo(cube2)); Assert.That(cube2, Is.EqualTo(cube1)); + Assert.That(cube1 == cube2); + Assert.That(cube2 == cube1); } [Test] public void Equals_ShouldBeFalse_GivenDifferentCubes() { Assert.That(Cuboid.Empty, Is.Not.EqualTo(Cuboid.Cube)); + Assert.That(Cuboid.Empty != Cuboid.Cube); } [Test] diff --git a/X10D.Tests/src/Drawing/EllipseFTests.cs b/X10D.Tests/src/Drawing/EllipseFTests.cs index a7fdd03..7ca40aa 100644 --- a/X10D.Tests/src/Drawing/EllipseFTests.cs +++ b/X10D.Tests/src/Drawing/EllipseFTests.cs @@ -49,18 +49,22 @@ public class EllipseFTests var unitEllipse2 = EllipseF.Unit; Assert.That(unitEllipse2, Is.EqualTo(unitEllipse1)); Assert.That(unitEllipse1, Is.EqualTo(unitEllipse2)); + Assert.That(unitEllipse2 == unitEllipse1); + Assert.That(unitEllipse1 == unitEllipse2); } [Test] public void Equals_ShouldBeFalse_GivenDifferentEllipses() { Assert.That(EllipseF.Empty, Is.Not.EqualTo(EllipseF.Unit)); + Assert.That(EllipseF.Empty != EllipseF.Unit); } [Test] public void Equals_ShouldBeFalse_GivenDifferentObjects() { Assert.That(EllipseF.Unit, Is.Not.EqualTo(null)); + Assert.That(EllipseF.Unit.Equals(null), Is.False); } [Test] @@ -100,6 +104,7 @@ public class EllipseFTests Assert.Multiple(() => { Assert.That(converted, Is.EqualTo((Ellipse)unitEllipse)); + Assert.That(converted == unitEllipse); Assert.That(converted.HorizontalRadius, Is.EqualTo(unitEllipse.HorizontalRadius)); Assert.That(converted.VerticalRadius, Is.EqualTo(unitEllipse.VerticalRadius)); Assert.That((PointF)converted.Center, Is.EqualTo(unitEllipse.Center)); @@ -115,6 +120,7 @@ public class EllipseFTests Assert.Multiple(() => { Assert.That(converted, Is.EqualTo((EllipseF)unitCircle)); + Assert.That(converted == unitCircle); Assert.That(converted.HorizontalRadius, Is.EqualTo(unitCircle.Radius)); Assert.That(converted.VerticalRadius, Is.EqualTo(unitCircle.Radius)); Assert.That(converted.Center, Is.EqualTo((PointF)unitCircle.Center)); diff --git a/X10D.Tests/src/Drawing/EllipseTests.cs b/X10D.Tests/src/Drawing/EllipseTests.cs index b740d28..529f1c6 100644 --- a/X10D.Tests/src/Drawing/EllipseTests.cs +++ b/X10D.Tests/src/Drawing/EllipseTests.cs @@ -48,6 +48,8 @@ public class EllipseTests { Assert.That(unitEllipse2, Is.EqualTo(unitEllipse1)); Assert.That(unitEllipse1, Is.EqualTo(unitEllipse2)); + Assert.That(unitEllipse2 == unitEllipse1); + Assert.That(unitEllipse1 == unitEllipse2); }); } @@ -58,6 +60,8 @@ public class EllipseTests { Assert.That(Ellipse.Empty, Is.Not.EqualTo(Ellipse.Unit)); Assert.That(Ellipse.Unit, Is.Not.EqualTo(Ellipse.Empty)); + Assert.That(Ellipse.Empty != Ellipse.Unit); + Assert.That(Ellipse.Unit != Ellipse.Empty); }); } diff --git a/X10D.Tests/src/Drawing/Line3DTests.cs b/X10D.Tests/src/Drawing/Line3DTests.cs index f001b00..f7db299 100644 --- a/X10D.Tests/src/Drawing/Line3DTests.cs +++ b/X10D.Tests/src/Drawing/Line3DTests.cs @@ -76,18 +76,21 @@ public class Line3DTests Line3D second = Line3D.One; Assert.That(second, Is.EqualTo(first)); + Assert.That(second == first); } [Test] public void Equals_ShouldBeFalse_GivenDifferentLines() { Assert.That(Line3D.Empty, Is.Not.EqualTo(Line3D.One)); + Assert.That(Line3D.Empty != Line3D.One); } [Test] public void Equals_ShouldBeFalse_GivenDifferentObjects() { Assert.That(Line3D.One, Is.Not.EqualTo(null)); + Assert.That(Line3D.One.Equals(null), Is.False); } [Test] @@ -145,6 +148,9 @@ public class Line3DTests { Assert.That(Line3D.One, Is.GreaterThan(Line3D.Empty)); Assert.That(Line3D.One, Is.GreaterThanOrEqualTo(Line3D.Empty)); + + Assert.That(Line3D.One > Line3D.Empty); + Assert.That(Line3D.One >= Line3D.Empty); } [Test] @@ -177,6 +183,7 @@ public class Line3DTests Assert.Multiple(() => { Assert.That(converted, Is.EqualTo((Line3D)oneLine)); + Assert.That(converted == oneLine); Assert.That(converted.Length, Is.EqualTo(oneLine.Length)); Assert.That(converted.Start, Is.EqualTo(expectedStart)); Assert.That(converted.End, Is.EqualTo(expectedEnd)); @@ -188,5 +195,7 @@ public class Line3DTests { Assert.That(Line3D.Empty, Is.LessThan(Line3D.One)); Assert.That(Line3D.Empty, Is.LessThanOrEqualTo(Line3D.One)); + Assert.That(Line3D.Empty < Line3D.One); + Assert.That(Line3D.Empty <= Line3D.One); } } diff --git a/X10D.Tests/src/Drawing/LineFTests.cs b/X10D.Tests/src/Drawing/LineFTests.cs index 3f59938..2c53cd4 100644 --- a/X10D.Tests/src/Drawing/LineFTests.cs +++ b/X10D.Tests/src/Drawing/LineFTests.cs @@ -71,6 +71,8 @@ public class LineFTests { Assert.That(second, Is.EqualTo(first)); Assert.That(first, Is.EqualTo(second)); + Assert.That(second == first); + Assert.That(first == second); }); } @@ -81,6 +83,8 @@ public class LineFTests { Assert.That(LineF.Empty, Is.Not.EqualTo(LineF.One)); Assert.That(LineF.One, Is.Not.EqualTo(LineF.Empty)); + Assert.That(LineF.Empty != LineF.One); + Assert.That(LineF.One != LineF.Empty); }); } @@ -88,6 +92,7 @@ public class LineFTests public void Equals_ShouldBeFalse_GivenDifferentObjects() { Assert.That(LineF.One, Is.Not.EqualTo(null)); + Assert.That(LineF.One.Equals(null), Is.False); } [Test] @@ -115,6 +120,7 @@ public class LineFTests Assert.Multiple(() => { Assert.That(converted, Is.EqualTo((Line)oneLine)); + Assert.That(converted == oneLine); Assert.That(converted.Length, Is.EqualTo(oneLine.Length)); Assert.That((PointF)converted.Start, Is.EqualTo(oneLine.Start)); Assert.That((PointF)converted.End, Is.EqualTo(oneLine.End)); @@ -126,6 +132,8 @@ public class LineFTests { Assert.That(LineF.One, Is.GreaterThan(LineF.Empty)); Assert.That(LineF.One, Is.GreaterThanOrEqualTo(LineF.Empty)); + Assert.That(LineF.One > LineF.Empty); + Assert.That(LineF.One >= LineF.Empty); } [Test] @@ -137,6 +145,7 @@ public class LineFTests Assert.Multiple(() => { Assert.That(converted, Is.EqualTo((LineF)oneLine)); + Assert.That(converted == oneLine); Assert.That(converted.Length, Is.EqualTo(oneLine.Length)); Assert.That(converted.Start, Is.EqualTo((PointF)oneLine.Start)); Assert.That(converted.End, Is.EqualTo((PointF)oneLine.End)); @@ -148,5 +157,7 @@ public class LineFTests { Assert.That(LineF.Empty, Is.LessThan(LineF.One)); Assert.That(LineF.Empty, Is.LessThanOrEqualTo(LineF.One)); + Assert.That(LineF.Empty < LineF.One); + Assert.That(LineF.Empty <= LineF.One); } } diff --git a/X10D.Tests/src/Drawing/LineTests.cs b/X10D.Tests/src/Drawing/LineTests.cs index 8fba47f..dfca225 100644 --- a/X10D.Tests/src/Drawing/LineTests.cs +++ b/X10D.Tests/src/Drawing/LineTests.cs @@ -53,6 +53,8 @@ public class LineTests { Assert.That(second, Is.EqualTo(first)); Assert.That(first, Is.EqualTo(second)); + Assert.That(second == first); + Assert.That(first == second); }); } @@ -63,6 +65,8 @@ public class LineTests { Assert.That(Line.Empty, Is.Not.EqualTo(Line.One)); Assert.That(Line.One, Is.Not.EqualTo(Line.Empty)); + Assert.That(Line.Empty != Line.One); + Assert.That(Line.One != Line.Empty); }); } @@ -70,6 +74,7 @@ public class LineTests public void Equals_ShouldBeFalse_GivenDifferentObjects() { Assert.That(Line.One, Is.Not.EqualTo(null)); + Assert.That(Line.One.Equals(null), Is.False); } [Test] @@ -111,6 +116,8 @@ public class LineTests { Assert.That(Line.One, Is.GreaterThan(Line.Empty)); Assert.That(Line.One, Is.GreaterThanOrEqualTo(Line.Empty)); + Assert.That(Line.One > Line.Empty); + Assert.That(Line.One >= Line.Empty); } [Test] @@ -118,5 +125,7 @@ public class LineTests { Assert.That(Line.Empty, Is.LessThan(Line.One)); Assert.That(Line.Empty, Is.LessThanOrEqualTo(Line.One)); + Assert.That(Line.Empty < Line.One); + Assert.That(Line.Empty <= Line.One); } } diff --git a/X10D.Tests/src/Drawing/PolygonFTests.cs b/X10D.Tests/src/Drawing/PolygonFTests.cs index 196b88c..9b7e626 100644 --- a/X10D.Tests/src/Drawing/PolygonFTests.cs +++ b/X10D.Tests/src/Drawing/PolygonFTests.cs @@ -108,6 +108,8 @@ public class PolygonFTests { Assert.That(second, Is.EqualTo(first)); Assert.That(first, Is.EqualTo(second)); + Assert.That(second == first); + Assert.That(first == second); }); } @@ -121,6 +123,8 @@ public class PolygonFTests { Assert.That(second, Is.EqualTo(first)); Assert.That(first, Is.EqualTo(second)); + Assert.That(second == first); + Assert.That(first == second); }); } @@ -134,6 +138,8 @@ public class PolygonFTests { Assert.That(second, Is.Not.EqualTo(first)); Assert.That(first, Is.Not.EqualTo(second)); + Assert.That(second != first); + Assert.That(first != second); }); } @@ -185,6 +191,7 @@ public class PolygonFTests Assert.Multiple(() => { Assert.That(converted, Is.EqualTo((PolygonF)polygon)); + Assert.That(converted == polygon); Assert.That(converted.IsConvex, Is.EqualTo(polygon.IsConvex)); Assert.That(converted.VertexCount, Is.EqualTo(polygon.VertexCount)); CollectionAssert.AreEqual(converted.Vertices, polygon.Vertices.Select(p => (PointF)p)); diff --git a/X10D.Tests/src/Drawing/PolygonTests.cs b/X10D.Tests/src/Drawing/PolygonTests.cs index 9d36dde..40e9da4 100644 --- a/X10D.Tests/src/Drawing/PolygonTests.cs +++ b/X10D.Tests/src/Drawing/PolygonTests.cs @@ -52,7 +52,7 @@ public class PolygonTests public void Constructor_ShouldThrowArgumentNullException_GivenNullEnumerableOfPoint() { IEnumerable vertices = null!; - Assert.Throws(() => new Polygon(vertices)); + Assert.Throws(() => _ = new Polygon(vertices)); } [Test] @@ -77,7 +77,7 @@ public class PolygonTests public void CopyConstructor_ShouldThrowArgumentNullException_GivenNullPolygon() { Polygon polygon = null!; - Assert.Throws(() => new Polygon(polygon)); + Assert.Throws(() => _ = new Polygon(polygon)); } [Test] @@ -90,6 +90,8 @@ public class PolygonTests { Assert.That(second, Is.EqualTo(first)); Assert.That(first, Is.EqualTo(second)); + Assert.That(second == first); + Assert.That(first == second); }); } @@ -103,6 +105,8 @@ public class PolygonTests { Assert.That(second, Is.EqualTo(first)); Assert.That(first, Is.EqualTo(second)); + Assert.That(second == first); + Assert.That(first == second); }); } @@ -116,6 +120,8 @@ public class PolygonTests { Assert.That(second, Is.Not.EqualTo(first)); Assert.That(first, Is.Not.EqualTo(second)); + Assert.That(second != first); + Assert.That(first != second); }); } diff --git a/X10D.Tests/src/Drawing/PolyhedronTests.cs b/X10D.Tests/src/Drawing/PolyhedronTests.cs index 78b50e4..608e7e1 100644 --- a/X10D.Tests/src/Drawing/PolyhedronTests.cs +++ b/X10D.Tests/src/Drawing/PolyhedronTests.cs @@ -105,6 +105,8 @@ public class PolyhedronTests { Assert.That(second, Is.EqualTo(first)); Assert.That(first, Is.EqualTo(second)); + Assert.That(second == first); + Assert.That(first == second); }); } @@ -118,6 +120,8 @@ public class PolyhedronTests { Assert.That(second, Is.Not.EqualTo(first)); Assert.That(first, Is.Not.EqualTo(second)); + Assert.That(second != first); + Assert.That(first != second); }); } diff --git a/X10D.Tests/src/Drawing/SphereTests.cs b/X10D.Tests/src/Drawing/SphereTests.cs index 90a4afa..2a61a8b 100644 --- a/X10D.Tests/src/Drawing/SphereTests.cs +++ b/X10D.Tests/src/Drawing/SphereTests.cs @@ -66,6 +66,8 @@ public class SphereTests { Assert.That(unitCircle2, Is.EqualTo(unitCircle1)); Assert.That(unitCircle1, Is.EqualTo(unitCircle2)); + Assert.That(unitCircle2 == unitCircle1); + Assert.That(unitCircle1 == unitCircle2); }); } @@ -73,6 +75,7 @@ public class SphereTests public void Equals_ShouldBeFalse_GivenDifferentObjects() { Assert.That(Sphere.Unit, Is.Not.EqualTo(null)); + Assert.That(Sphere.Unit.Equals(null), Is.False); } [Test] @@ -80,6 +83,8 @@ public class SphereTests { Assert.That(Sphere.Empty, Is.Not.EqualTo(Sphere.Unit)); Assert.That(Sphere.Unit, Is.Not.EqualTo(Sphere.Empty)); + Assert.That(Sphere.Empty != Sphere.Unit); + Assert.That(Sphere.Unit != Sphere.Empty); } [Test] @@ -103,6 +108,8 @@ public class SphereTests { Assert.That(Sphere.Unit, Is.GreaterThan(Sphere.Empty)); Assert.That(Sphere.Unit, Is.GreaterThanOrEqualTo(Sphere.Empty)); + Assert.That(Sphere.Unit > Sphere.Empty); + Assert.That(Sphere.Unit >= Sphere.Empty); } [Test] @@ -110,6 +117,8 @@ public class SphereTests { Assert.That(Sphere.Empty, Is.LessThan(Sphere.Unit)); Assert.That(Sphere.Empty, Is.LessThanOrEqualTo(Sphere.Unit)); + Assert.That(Sphere.Empty < Sphere.Unit); + Assert.That(Sphere.Empty <= Sphere.Unit); } [Test] diff --git a/X10D.Tests/src/Reflection/MemberInfoTests.cs b/X10D.Tests/src/Reflection/MemberInfoTests.cs index 5f6e2cb..edc2ebf 100644 --- a/X10D.Tests/src/Reflection/MemberInfoTests.cs +++ b/X10D.Tests/src/Reflection/MemberInfoTests.cs @@ -59,10 +59,10 @@ public class MemberInfoTests Func predicate = attribute => attribute.IsCompliant; Assert.Multiple(() => { - Assert.That(typeof(byte).SelectFromCustomAttribute(predicate)); - Assert.That(typeof(short).SelectFromCustomAttribute(predicate)); - Assert.That(typeof(int).SelectFromCustomAttribute(predicate)); - Assert.That(typeof(long).SelectFromCustomAttribute(predicate)); + Assert.That(typeof(byte).SelectFromCustomAttribute(predicate, true)); + Assert.That(typeof(short).SelectFromCustomAttribute(predicate, true)); + Assert.That(typeof(int).SelectFromCustomAttribute(predicate, true)); + Assert.That(typeof(long).SelectFromCustomAttribute(predicate, true)); }); }