Skip to content

Commit 243d75b

Browse files
committed
Data and Logic test adjustments after changes.
1 parent da130c6 commit 243d75b

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

LogicTest/LogicTest.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,12 @@ public void ballConstructorTest()
3232
Vector2 testPosition = new Vector2(2, 4);
3333
Vector2 testVelocity = new Vector2(3, 6);
3434
int radius = 10;
35-
Ball ball = new Ball(radius, testPosition, testVelocity);
35+
float mass = 5f;
36+
Ball ball = new Ball(radius, testPosition, testVelocity, mass);
3637
Assert.AreEqual(radius, ball.Radius);
3738
Assert.AreEqual(testPosition, ball.Position);
3839
Assert.AreEqual(testVelocity, ball.Velocity);
40+
Assert.AreEqual(mass, ball.Mass);
3941
}
4042

4143
[Test]
@@ -44,7 +46,8 @@ public void changeVelocityTest()
4446
Vector2 testPosition = new Vector2(2, 4);
4547
Vector2 testVelocity = new Vector2(3, 6);
4648
int radius = 10;
47-
Ball ball = new Ball(radius, testPosition, testVelocity);
49+
float mass = 5f;
50+
Ball ball = new Ball(radius, testPosition, testVelocity, mass);
4851
ball.Velocity = new Vector2(6, 12);
4952
Assert.AreEqual(6, ball.Velocity.X);
5053
Assert.AreEqual(12, ball.Velocity.Y);
@@ -56,7 +59,8 @@ public void setPositionTest()
5659
Vector2 testPosition = new Vector2(_logicAPI.table.Width, _logicAPI.table.Height);
5760
Vector2 testVelocity = new Vector2(1, 2);
5861
int radius = 10;
59-
Ball ball = new Ball(radius, testPosition, testVelocity);
62+
float mass = 5f;
63+
Ball ball = new Ball(radius, testPosition, testVelocity, mass);
6064
BallLogic ballLogic = new BallLogic(ball);
6165
ballLogic.setPosition();
6266
Assert.AreNotEqual(_logicAPI.table.Width, ball.Position.X);

ModelTest/ModelTest.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ public override BallLogic createBall(int radius, Vector2 position)
2020
}
2121
public override void createBalls(int amount, int radius)
2222
{
23+
float mass = 5f;
2324
for (int i = 0; i < amount; i++)
2425
{
25-
balls.Add(new BallLogic(new Ball(radius, Vector2.Zero, Vector2.Zero)));
26+
balls.Add(new BallLogic(new Ball(radius, Vector2.Zero, Vector2.Zero, mass)));
2627
}
2728
}
2829

0 commit comments

Comments
 (0)