added Algorithms/SierpinskiTriangle.cs

This commit is contained in:
didier amyot committed 2023-08-28 09:30:26 -04:00
1 parent 6acd8c8ff1
commit a832521bda
7 files changed
+137 -4

No files matched your search

+32
View File
@@ -0,0 +1,32 @@
namespace Algorithms.Tests;
using Algorithms;
[TestClass]
public class PointTest
{
[TestMethod]
public void TestToString()
{
Point point = new Point(0, 1);
Assert.AreEqual("{\"x\": 0, \"y\": 1}", point.ToString());
}
[TestMethod]
public void TestMidPointOf(){
Point point1 = new Point(2, 6);
Point point2 = new Point(5, 3);
Point res = point1.MidPointOf(point2);
Assert.AreEqual(3.5, res.X(), 0.001);
Assert.AreEqual(4.5, res.Y(), 0.001);
}
[TestMethod]
public void TestDistance(){
Point point1 = new Point(2, 6);
Point point2 = new Point(5, 3);
Assert.AreEqual(4.24264, point1.Distance(point2), 0.001);
}
}