mirror of
https://github.com/oliverbooth/X10D
synced 2024-11-09 22:55:42 +00:00
test: return coverage to 100% (#76)
This commit is contained in:
parent
fcdcf54aa3
commit
4a0e3c10d7
@ -55,7 +55,7 @@ public class ByteTests
|
|||||||
Assert.Multiple(() =>
|
Assert.Multiple(() =>
|
||||||
{
|
{
|
||||||
Span<bool> bits = stackalloc bool[8];
|
Span<bool> bits = stackalloc bool[8];
|
||||||
value.Unpack(bits);
|
value.UnpackInternal_Fallback(bits);
|
||||||
|
|
||||||
Assert.That(bits[0], Is.False);
|
Assert.That(bits[0], Is.False);
|
||||||
Assert.That(bits[1], Is.False);
|
Assert.That(bits[1], Is.False);
|
||||||
|
@ -97,6 +97,9 @@ public class CircleFTests
|
|||||||
{
|
{
|
||||||
Assert.That(CircleF.Empty, Is.Not.EqualTo(CircleF.Unit));
|
Assert.That(CircleF.Empty, Is.Not.EqualTo(CircleF.Unit));
|
||||||
Assert.That(CircleF.Unit, Is.Not.EqualTo(CircleF.Empty));
|
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()
|
public void Equals_ShouldBeFalse_GivenDifferentObjects()
|
||||||
{
|
{
|
||||||
Assert.That(CircleF.Empty, Is.Not.EqualTo(null));
|
Assert.That(CircleF.Empty, Is.Not.EqualTo(null));
|
||||||
|
Assert.That(CircleF.Empty.Equals(null), Is.False);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@ -131,6 +135,7 @@ public class CircleFTests
|
|||||||
Assert.Multiple(() =>
|
Assert.Multiple(() =>
|
||||||
{
|
{
|
||||||
Assert.That(converted, Is.EqualTo((Circle)unitCircle));
|
Assert.That(converted, Is.EqualTo((Circle)unitCircle));
|
||||||
|
Assert.That(converted == (Circle)unitCircle);
|
||||||
Assert.That(converted.Radius, Is.EqualTo(unitCircle.Radius));
|
Assert.That(converted.Radius, Is.EqualTo(unitCircle.Radius));
|
||||||
Assert.That((PointF)converted.Center, Is.EqualTo(unitCircle.Center));
|
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.GreaterThan(CircleF.Empty));
|
||||||
Assert.That(CircleF.Unit, Is.GreaterThanOrEqualTo(CircleF.Empty));
|
Assert.That(CircleF.Unit, Is.GreaterThanOrEqualTo(CircleF.Empty));
|
||||||
|
|
||||||
|
Assert.That(CircleF.Unit > CircleF.Empty);
|
||||||
|
Assert.That(CircleF.Unit >= CircleF.Empty);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@ -152,6 +160,7 @@ public class CircleFTests
|
|||||||
Assert.Multiple(() =>
|
Assert.Multiple(() =>
|
||||||
{
|
{
|
||||||
Assert.That(converted, Is.EqualTo((CircleF)unitCircle));
|
Assert.That(converted, Is.EqualTo((CircleF)unitCircle));
|
||||||
|
Assert.That(converted == unitCircle);
|
||||||
Assert.That(converted.Radius, Is.EqualTo(unitCircle.Radius));
|
Assert.That(converted.Radius, Is.EqualTo(unitCircle.Radius));
|
||||||
Assert.That(converted.Center, Is.EqualTo((PointF)unitCircle.Center));
|
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.LessThan(CircleF.Unit));
|
||||||
Assert.That(CircleF.Empty, Is.LessThanOrEqualTo(CircleF.Unit));
|
Assert.That(CircleF.Empty, Is.LessThanOrEqualTo(CircleF.Unit));
|
||||||
|
|
||||||
|
Assert.That(CircleF.Empty < CircleF.Unit);
|
||||||
|
Assert.That(CircleF.Empty <= CircleF.Unit);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -94,6 +94,9 @@ public class CircleTests
|
|||||||
{
|
{
|
||||||
Assert.That(Circle.Empty, Is.Not.EqualTo(Circle.Unit));
|
Assert.That(Circle.Empty, Is.Not.EqualTo(Circle.Unit));
|
||||||
Assert.That(Circle.Unit, Is.Not.EqualTo(Circle.Empty));
|
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()
|
public void Equals_ShouldBeFalse_GivenDifferentObjects()
|
||||||
{
|
{
|
||||||
Assert.That(Circle.Empty, Is.Not.EqualTo(null));
|
Assert.That(Circle.Empty, Is.Not.EqualTo(null));
|
||||||
|
Assert.That(Circle.Empty.Equals(null), Is.False);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@ -121,16 +125,26 @@ public class CircleTests
|
|||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void op_GreaterThan_True_GivenUnitAndEmptyCircle()
|
public void op_GreaterThan_True_GivenUnitAndEmptyCircle()
|
||||||
|
{
|
||||||
|
Assert.Multiple(() =>
|
||||||
{
|
{
|
||||||
Assert.That(Circle.Unit, Is.GreaterThan(Circle.Empty));
|
Assert.That(Circle.Unit, Is.GreaterThan(Circle.Empty));
|
||||||
Assert.That(Circle.Unit, Is.GreaterThanOrEqualTo(Circle.Empty));
|
Assert.That(Circle.Unit, Is.GreaterThanOrEqualTo(Circle.Empty));
|
||||||
|
Assert.That(Circle.Unit > Circle.Empty);
|
||||||
|
Assert.That(Circle.Unit >= Circle.Empty);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void op_LessThan_True_GivenEmptyAndUnitCircle()
|
public void op_LessThan_True_GivenEmptyAndUnitCircle()
|
||||||
|
{
|
||||||
|
Assert.Multiple(() =>
|
||||||
{
|
{
|
||||||
Assert.That(Circle.Empty, Is.LessThan(Circle.Unit));
|
Assert.That(Circle.Empty, Is.LessThan(Circle.Unit));
|
||||||
Assert.That(Circle.Empty, Is.LessThanOrEqualTo(Circle.Unit));
|
Assert.That(Circle.Empty, Is.LessThanOrEqualTo(Circle.Unit));
|
||||||
|
Assert.That(Circle.Empty < Circle.Unit);
|
||||||
|
Assert.That(Circle.Empty <= Circle.Unit);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
@ -29,12 +29,15 @@ public class CuboidTests
|
|||||||
var cube2 = Cuboid.Cube;
|
var cube2 = Cuboid.Cube;
|
||||||
Assert.That(cube1, Is.EqualTo(cube2));
|
Assert.That(cube1, Is.EqualTo(cube2));
|
||||||
Assert.That(cube2, Is.EqualTo(cube1));
|
Assert.That(cube2, Is.EqualTo(cube1));
|
||||||
|
Assert.That(cube1 == cube2);
|
||||||
|
Assert.That(cube2 == cube1);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void Equals_ShouldBeFalse_GivenDifferentCubes()
|
public void Equals_ShouldBeFalse_GivenDifferentCubes()
|
||||||
{
|
{
|
||||||
Assert.That(Cuboid.Empty, Is.Not.EqualTo(Cuboid.Cube));
|
Assert.That(Cuboid.Empty, Is.Not.EqualTo(Cuboid.Cube));
|
||||||
|
Assert.That(Cuboid.Empty != Cuboid.Cube);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
@ -49,18 +49,22 @@ public class EllipseFTests
|
|||||||
var unitEllipse2 = EllipseF.Unit;
|
var unitEllipse2 = EllipseF.Unit;
|
||||||
Assert.That(unitEllipse2, Is.EqualTo(unitEllipse1));
|
Assert.That(unitEllipse2, Is.EqualTo(unitEllipse1));
|
||||||
Assert.That(unitEllipse1, Is.EqualTo(unitEllipse2));
|
Assert.That(unitEllipse1, Is.EqualTo(unitEllipse2));
|
||||||
|
Assert.That(unitEllipse2 == unitEllipse1);
|
||||||
|
Assert.That(unitEllipse1 == unitEllipse2);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void Equals_ShouldBeFalse_GivenDifferentEllipses()
|
public void Equals_ShouldBeFalse_GivenDifferentEllipses()
|
||||||
{
|
{
|
||||||
Assert.That(EllipseF.Empty, Is.Not.EqualTo(EllipseF.Unit));
|
Assert.That(EllipseF.Empty, Is.Not.EqualTo(EllipseF.Unit));
|
||||||
|
Assert.That(EllipseF.Empty != EllipseF.Unit);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void Equals_ShouldBeFalse_GivenDifferentObjects()
|
public void Equals_ShouldBeFalse_GivenDifferentObjects()
|
||||||
{
|
{
|
||||||
Assert.That(EllipseF.Unit, Is.Not.EqualTo(null));
|
Assert.That(EllipseF.Unit, Is.Not.EqualTo(null));
|
||||||
|
Assert.That(EllipseF.Unit.Equals(null), Is.False);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@ -100,6 +104,7 @@ public class EllipseFTests
|
|||||||
Assert.Multiple(() =>
|
Assert.Multiple(() =>
|
||||||
{
|
{
|
||||||
Assert.That(converted, Is.EqualTo((Ellipse)unitEllipse));
|
Assert.That(converted, Is.EqualTo((Ellipse)unitEllipse));
|
||||||
|
Assert.That(converted == unitEllipse);
|
||||||
Assert.That(converted.HorizontalRadius, Is.EqualTo(unitEllipse.HorizontalRadius));
|
Assert.That(converted.HorizontalRadius, Is.EqualTo(unitEllipse.HorizontalRadius));
|
||||||
Assert.That(converted.VerticalRadius, Is.EqualTo(unitEllipse.VerticalRadius));
|
Assert.That(converted.VerticalRadius, Is.EqualTo(unitEllipse.VerticalRadius));
|
||||||
Assert.That((PointF)converted.Center, Is.EqualTo(unitEllipse.Center));
|
Assert.That((PointF)converted.Center, Is.EqualTo(unitEllipse.Center));
|
||||||
@ -115,6 +120,7 @@ public class EllipseFTests
|
|||||||
Assert.Multiple(() =>
|
Assert.Multiple(() =>
|
||||||
{
|
{
|
||||||
Assert.That(converted, Is.EqualTo((EllipseF)unitCircle));
|
Assert.That(converted, Is.EqualTo((EllipseF)unitCircle));
|
||||||
|
Assert.That(converted == unitCircle);
|
||||||
Assert.That(converted.HorizontalRadius, Is.EqualTo(unitCircle.Radius));
|
Assert.That(converted.HorizontalRadius, Is.EqualTo(unitCircle.Radius));
|
||||||
Assert.That(converted.VerticalRadius, Is.EqualTo(unitCircle.Radius));
|
Assert.That(converted.VerticalRadius, Is.EqualTo(unitCircle.Radius));
|
||||||
Assert.That(converted.Center, Is.EqualTo((PointF)unitCircle.Center));
|
Assert.That(converted.Center, Is.EqualTo((PointF)unitCircle.Center));
|
||||||
|
@ -48,6 +48,8 @@ public class EllipseTests
|
|||||||
{
|
{
|
||||||
Assert.That(unitEllipse2, Is.EqualTo(unitEllipse1));
|
Assert.That(unitEllipse2, Is.EqualTo(unitEllipse1));
|
||||||
Assert.That(unitEllipse1, Is.EqualTo(unitEllipse2));
|
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.Empty, Is.Not.EqualTo(Ellipse.Unit));
|
||||||
Assert.That(Ellipse.Unit, Is.Not.EqualTo(Ellipse.Empty));
|
Assert.That(Ellipse.Unit, Is.Not.EqualTo(Ellipse.Empty));
|
||||||
|
Assert.That(Ellipse.Empty != Ellipse.Unit);
|
||||||
|
Assert.That(Ellipse.Unit != Ellipse.Empty);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,18 +76,21 @@ public class Line3DTests
|
|||||||
Line3D second = Line3D.One;
|
Line3D second = Line3D.One;
|
||||||
|
|
||||||
Assert.That(second, Is.EqualTo(first));
|
Assert.That(second, Is.EqualTo(first));
|
||||||
|
Assert.That(second == first);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void Equals_ShouldBeFalse_GivenDifferentLines()
|
public void Equals_ShouldBeFalse_GivenDifferentLines()
|
||||||
{
|
{
|
||||||
Assert.That(Line3D.Empty, Is.Not.EqualTo(Line3D.One));
|
Assert.That(Line3D.Empty, Is.Not.EqualTo(Line3D.One));
|
||||||
|
Assert.That(Line3D.Empty != Line3D.One);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void Equals_ShouldBeFalse_GivenDifferentObjects()
|
public void Equals_ShouldBeFalse_GivenDifferentObjects()
|
||||||
{
|
{
|
||||||
Assert.That(Line3D.One, Is.Not.EqualTo(null));
|
Assert.That(Line3D.One, Is.Not.EqualTo(null));
|
||||||
|
Assert.That(Line3D.One.Equals(null), Is.False);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@ -145,6 +148,9 @@ public class Line3DTests
|
|||||||
{
|
{
|
||||||
Assert.That(Line3D.One, Is.GreaterThan(Line3D.Empty));
|
Assert.That(Line3D.One, Is.GreaterThan(Line3D.Empty));
|
||||||
Assert.That(Line3D.One, Is.GreaterThanOrEqualTo(Line3D.Empty));
|
Assert.That(Line3D.One, Is.GreaterThanOrEqualTo(Line3D.Empty));
|
||||||
|
|
||||||
|
Assert.That(Line3D.One > Line3D.Empty);
|
||||||
|
Assert.That(Line3D.One >= Line3D.Empty);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@ -177,6 +183,7 @@ public class Line3DTests
|
|||||||
Assert.Multiple(() =>
|
Assert.Multiple(() =>
|
||||||
{
|
{
|
||||||
Assert.That(converted, Is.EqualTo((Line3D)oneLine));
|
Assert.That(converted, Is.EqualTo((Line3D)oneLine));
|
||||||
|
Assert.That(converted == oneLine);
|
||||||
Assert.That(converted.Length, Is.EqualTo(oneLine.Length));
|
Assert.That(converted.Length, Is.EqualTo(oneLine.Length));
|
||||||
Assert.That(converted.Start, Is.EqualTo(expectedStart));
|
Assert.That(converted.Start, Is.EqualTo(expectedStart));
|
||||||
Assert.That(converted.End, Is.EqualTo(expectedEnd));
|
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.LessThan(Line3D.One));
|
||||||
Assert.That(Line3D.Empty, Is.LessThanOrEqualTo(Line3D.One));
|
Assert.That(Line3D.Empty, Is.LessThanOrEqualTo(Line3D.One));
|
||||||
|
Assert.That(Line3D.Empty < Line3D.One);
|
||||||
|
Assert.That(Line3D.Empty <= Line3D.One);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -71,6 +71,8 @@ public class LineFTests
|
|||||||
{
|
{
|
||||||
Assert.That(second, Is.EqualTo(first));
|
Assert.That(second, Is.EqualTo(first));
|
||||||
Assert.That(first, Is.EqualTo(second));
|
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.Empty, Is.Not.EqualTo(LineF.One));
|
||||||
Assert.That(LineF.One, Is.Not.EqualTo(LineF.Empty));
|
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()
|
public void Equals_ShouldBeFalse_GivenDifferentObjects()
|
||||||
{
|
{
|
||||||
Assert.That(LineF.One, Is.Not.EqualTo(null));
|
Assert.That(LineF.One, Is.Not.EqualTo(null));
|
||||||
|
Assert.That(LineF.One.Equals(null), Is.False);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@ -115,6 +120,7 @@ public class LineFTests
|
|||||||
Assert.Multiple(() =>
|
Assert.Multiple(() =>
|
||||||
{
|
{
|
||||||
Assert.That(converted, Is.EqualTo((Line)oneLine));
|
Assert.That(converted, Is.EqualTo((Line)oneLine));
|
||||||
|
Assert.That(converted == oneLine);
|
||||||
Assert.That(converted.Length, Is.EqualTo(oneLine.Length));
|
Assert.That(converted.Length, Is.EqualTo(oneLine.Length));
|
||||||
Assert.That((PointF)converted.Start, Is.EqualTo(oneLine.Start));
|
Assert.That((PointF)converted.Start, Is.EqualTo(oneLine.Start));
|
||||||
Assert.That((PointF)converted.End, Is.EqualTo(oneLine.End));
|
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.GreaterThan(LineF.Empty));
|
||||||
Assert.That(LineF.One, Is.GreaterThanOrEqualTo(LineF.Empty));
|
Assert.That(LineF.One, Is.GreaterThanOrEqualTo(LineF.Empty));
|
||||||
|
Assert.That(LineF.One > LineF.Empty);
|
||||||
|
Assert.That(LineF.One >= LineF.Empty);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@ -137,6 +145,7 @@ public class LineFTests
|
|||||||
Assert.Multiple(() =>
|
Assert.Multiple(() =>
|
||||||
{
|
{
|
||||||
Assert.That(converted, Is.EqualTo((LineF)oneLine));
|
Assert.That(converted, Is.EqualTo((LineF)oneLine));
|
||||||
|
Assert.That(converted == oneLine);
|
||||||
Assert.That(converted.Length, Is.EqualTo(oneLine.Length));
|
Assert.That(converted.Length, Is.EqualTo(oneLine.Length));
|
||||||
Assert.That(converted.Start, Is.EqualTo((PointF)oneLine.Start));
|
Assert.That(converted.Start, Is.EqualTo((PointF)oneLine.Start));
|
||||||
Assert.That(converted.End, Is.EqualTo((PointF)oneLine.End));
|
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.LessThan(LineF.One));
|
||||||
Assert.That(LineF.Empty, Is.LessThanOrEqualTo(LineF.One));
|
Assert.That(LineF.Empty, Is.LessThanOrEqualTo(LineF.One));
|
||||||
|
Assert.That(LineF.Empty < LineF.One);
|
||||||
|
Assert.That(LineF.Empty <= LineF.One);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -53,6 +53,8 @@ public class LineTests
|
|||||||
{
|
{
|
||||||
Assert.That(second, Is.EqualTo(first));
|
Assert.That(second, Is.EqualTo(first));
|
||||||
Assert.That(first, Is.EqualTo(second));
|
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.Empty, Is.Not.EqualTo(Line.One));
|
||||||
Assert.That(Line.One, Is.Not.EqualTo(Line.Empty));
|
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()
|
public void Equals_ShouldBeFalse_GivenDifferentObjects()
|
||||||
{
|
{
|
||||||
Assert.That(Line.One, Is.Not.EqualTo(null));
|
Assert.That(Line.One, Is.Not.EqualTo(null));
|
||||||
|
Assert.That(Line.One.Equals(null), Is.False);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@ -111,6 +116,8 @@ public class LineTests
|
|||||||
{
|
{
|
||||||
Assert.That(Line.One, Is.GreaterThan(Line.Empty));
|
Assert.That(Line.One, Is.GreaterThan(Line.Empty));
|
||||||
Assert.That(Line.One, Is.GreaterThanOrEqualTo(Line.Empty));
|
Assert.That(Line.One, Is.GreaterThanOrEqualTo(Line.Empty));
|
||||||
|
Assert.That(Line.One > Line.Empty);
|
||||||
|
Assert.That(Line.One >= Line.Empty);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@ -118,5 +125,7 @@ public class LineTests
|
|||||||
{
|
{
|
||||||
Assert.That(Line.Empty, Is.LessThan(Line.One));
|
Assert.That(Line.Empty, Is.LessThan(Line.One));
|
||||||
Assert.That(Line.Empty, Is.LessThanOrEqualTo(Line.One));
|
Assert.That(Line.Empty, Is.LessThanOrEqualTo(Line.One));
|
||||||
|
Assert.That(Line.Empty < Line.One);
|
||||||
|
Assert.That(Line.Empty <= Line.One);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -108,6 +108,8 @@ public class PolygonFTests
|
|||||||
{
|
{
|
||||||
Assert.That(second, Is.EqualTo(first));
|
Assert.That(second, Is.EqualTo(first));
|
||||||
Assert.That(first, Is.EqualTo(second));
|
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(second, Is.EqualTo(first));
|
||||||
Assert.That(first, Is.EqualTo(second));
|
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(second, Is.Not.EqualTo(first));
|
||||||
Assert.That(first, Is.Not.EqualTo(second));
|
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.Multiple(() =>
|
||||||
{
|
{
|
||||||
Assert.That(converted, Is.EqualTo((PolygonF)polygon));
|
Assert.That(converted, Is.EqualTo((PolygonF)polygon));
|
||||||
|
Assert.That(converted == polygon);
|
||||||
Assert.That(converted.IsConvex, Is.EqualTo(polygon.IsConvex));
|
Assert.That(converted.IsConvex, Is.EqualTo(polygon.IsConvex));
|
||||||
Assert.That(converted.VertexCount, Is.EqualTo(polygon.VertexCount));
|
Assert.That(converted.VertexCount, Is.EqualTo(polygon.VertexCount));
|
||||||
CollectionAssert.AreEqual(converted.Vertices, polygon.Vertices.Select(p => (PointF)p));
|
CollectionAssert.AreEqual(converted.Vertices, polygon.Vertices.Select(p => (PointF)p));
|
||||||
|
@ -52,7 +52,7 @@ public class PolygonTests
|
|||||||
public void Constructor_ShouldThrowArgumentNullException_GivenNullEnumerableOfPoint()
|
public void Constructor_ShouldThrowArgumentNullException_GivenNullEnumerableOfPoint()
|
||||||
{
|
{
|
||||||
IEnumerable<Point> vertices = null!;
|
IEnumerable<Point> vertices = null!;
|
||||||
Assert.Throws<ArgumentNullException>(() => new Polygon(vertices));
|
Assert.Throws<ArgumentNullException>(() => _ = new Polygon(vertices));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@ -77,7 +77,7 @@ public class PolygonTests
|
|||||||
public void CopyConstructor_ShouldThrowArgumentNullException_GivenNullPolygon()
|
public void CopyConstructor_ShouldThrowArgumentNullException_GivenNullPolygon()
|
||||||
{
|
{
|
||||||
Polygon polygon = null!;
|
Polygon polygon = null!;
|
||||||
Assert.Throws<ArgumentNullException>(() => new Polygon(polygon));
|
Assert.Throws<ArgumentNullException>(() => _ = new Polygon(polygon));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@ -90,6 +90,8 @@ public class PolygonTests
|
|||||||
{
|
{
|
||||||
Assert.That(second, Is.EqualTo(first));
|
Assert.That(second, Is.EqualTo(first));
|
||||||
Assert.That(first, Is.EqualTo(second));
|
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(second, Is.EqualTo(first));
|
||||||
Assert.That(first, Is.EqualTo(second));
|
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(second, Is.Not.EqualTo(first));
|
||||||
Assert.That(first, Is.Not.EqualTo(second));
|
Assert.That(first, Is.Not.EqualTo(second));
|
||||||
|
Assert.That(second != first);
|
||||||
|
Assert.That(first != second);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,6 +105,8 @@ public class PolyhedronTests
|
|||||||
{
|
{
|
||||||
Assert.That(second, Is.EqualTo(first));
|
Assert.That(second, Is.EqualTo(first));
|
||||||
Assert.That(first, Is.EqualTo(second));
|
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(second, Is.Not.EqualTo(first));
|
||||||
Assert.That(first, Is.Not.EqualTo(second));
|
Assert.That(first, Is.Not.EqualTo(second));
|
||||||
|
Assert.That(second != first);
|
||||||
|
Assert.That(first != second);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,6 +66,8 @@ public class SphereTests
|
|||||||
{
|
{
|
||||||
Assert.That(unitCircle2, Is.EqualTo(unitCircle1));
|
Assert.That(unitCircle2, Is.EqualTo(unitCircle1));
|
||||||
Assert.That(unitCircle1, Is.EqualTo(unitCircle2));
|
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()
|
public void Equals_ShouldBeFalse_GivenDifferentObjects()
|
||||||
{
|
{
|
||||||
Assert.That(Sphere.Unit, Is.Not.EqualTo(null));
|
Assert.That(Sphere.Unit, Is.Not.EqualTo(null));
|
||||||
|
Assert.That(Sphere.Unit.Equals(null), Is.False);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@ -80,6 +83,8 @@ public class SphereTests
|
|||||||
{
|
{
|
||||||
Assert.That(Sphere.Empty, Is.Not.EqualTo(Sphere.Unit));
|
Assert.That(Sphere.Empty, Is.Not.EqualTo(Sphere.Unit));
|
||||||
Assert.That(Sphere.Unit, Is.Not.EqualTo(Sphere.Empty));
|
Assert.That(Sphere.Unit, Is.Not.EqualTo(Sphere.Empty));
|
||||||
|
Assert.That(Sphere.Empty != Sphere.Unit);
|
||||||
|
Assert.That(Sphere.Unit != Sphere.Empty);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@ -103,6 +108,8 @@ public class SphereTests
|
|||||||
{
|
{
|
||||||
Assert.That(Sphere.Unit, Is.GreaterThan(Sphere.Empty));
|
Assert.That(Sphere.Unit, Is.GreaterThan(Sphere.Empty));
|
||||||
Assert.That(Sphere.Unit, Is.GreaterThanOrEqualTo(Sphere.Empty));
|
Assert.That(Sphere.Unit, Is.GreaterThanOrEqualTo(Sphere.Empty));
|
||||||
|
Assert.That(Sphere.Unit > Sphere.Empty);
|
||||||
|
Assert.That(Sphere.Unit >= Sphere.Empty);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@ -110,6 +117,8 @@ public class SphereTests
|
|||||||
{
|
{
|
||||||
Assert.That(Sphere.Empty, Is.LessThan(Sphere.Unit));
|
Assert.That(Sphere.Empty, Is.LessThan(Sphere.Unit));
|
||||||
Assert.That(Sphere.Empty, Is.LessThanOrEqualTo(Sphere.Unit));
|
Assert.That(Sphere.Empty, Is.LessThanOrEqualTo(Sphere.Unit));
|
||||||
|
Assert.That(Sphere.Empty < Sphere.Unit);
|
||||||
|
Assert.That(Sphere.Empty <= Sphere.Unit);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
@ -59,10 +59,10 @@ public class MemberInfoTests
|
|||||||
Func<CLSCompliantAttribute, bool> predicate = attribute => attribute.IsCompliant;
|
Func<CLSCompliantAttribute, bool> predicate = attribute => attribute.IsCompliant;
|
||||||
Assert.Multiple(() =>
|
Assert.Multiple(() =>
|
||||||
{
|
{
|
||||||
Assert.That(typeof(byte).SelectFromCustomAttribute(predicate));
|
Assert.That(typeof(byte).SelectFromCustomAttribute(predicate, true));
|
||||||
Assert.That(typeof(short).SelectFromCustomAttribute(predicate));
|
Assert.That(typeof(short).SelectFromCustomAttribute(predicate, true));
|
||||||
Assert.That(typeof(int).SelectFromCustomAttribute(predicate));
|
Assert.That(typeof(int).SelectFromCustomAttribute(predicate, true));
|
||||||
Assert.That(typeof(long).SelectFromCustomAttribute(predicate));
|
Assert.That(typeof(long).SelectFromCustomAttribute(predicate, true));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user