Skip to content

Commit 1a536cf

Browse files
authored
Merge branch 'main' into finding-autofix-733fec3b
2 parents 52aeada + 0ecab5b commit 1a536cf

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/MandMCounter.Tests/Controllers/PeanutMandMControllerTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public void ControllerCountPeanutMandMsInA1CubicCMTest()
4343
float result = controller.GetDataForRectangle(unit, height, width, length);
4444

4545
//Assert
46-
Assert.IsTrue(System.Math.Round(result, 0) == 764f);
46+
Assert.IsTrue((int)System.Math.Round(result, 0) == (int)764f);
4747
}
4848

4949
#endregion

src/MandMCounter.Tests/Controllers/SkittleControllerTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public void ControllerCountSkittlesInAUSCupTest()
2222
float result = controller.GetDataForUnit(unit, quantity);
2323

2424
//Assert
25-
Assert.IsTrue(System.Math.Round(result, 0) == 212f);
25+
Assert.IsTrue(System.Math.Abs(System.Math.Round(result, 0) - 212f) < 0.0001f);
2626
}
2727

2828
#endregion
@@ -43,7 +43,7 @@ public void ControllerCountSkittlesInA1CubicCMTest()
4343
float result = controller.GetDataForRectangle(unit, height, width, length);
4444

4545
//Assert
46-
Assert.IsTrue(System.Math.Round(result, 0) == 896f);
46+
Assert.IsTrue(System.Math.Abs(System.Math.Round(result, 0) - 896f) < 0.0001f);
4747
}
4848

4949
#endregion
@@ -63,7 +63,7 @@ public void ControllerCountSkittlesInACylinderWithCMTest()
6363
float result = controller.GetDataForCylinder(unit, height, radius);
6464

6565
//Assert
66-
Assert.IsTrue(System.Math.Round(result, 0) == 704f);
66+
Assert.IsTrue(System.Math.Abs(System.Math.Round(result, 0) - 704f) < 0.0001f);
6767
}
6868

6969
#endregion

src/MandMCounter.Tests/PeanutMandMTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public void CountPeanutMandMsInAUSGallonTest()
2222
float result = Calculator.CountPeanutMandMs(unit, quantity);
2323

2424
//Assert
25-
Assert.IsTrue(System.Math.Round(result, 0) == 2892f);
25+
Assert.AreEqual(2892, (int)System.Math.Round(result, 0));
2626
}
2727

2828
[TestMethod]
@@ -37,7 +37,7 @@ public void CountPeanutMandMsInAUSQuartTest()
3737
float result = Calculator.CountPeanutMandMs(unit, quantity);
3838

3939
//Assert
40-
Assert.IsTrue(System.Math.Round(result, 0) == 1446f);
40+
Assert.AreEqual(1446, (int)System.Math.Round(result, 0));
4141
}
4242

4343
[TestMethod]
@@ -52,7 +52,7 @@ public void CountPeanutMandMsInAUSCupTest()
5252
float result = Calculator.CountPeanutMandMs(unit, quantity);
5353

5454
//Assert
55-
Assert.IsTrue(System.Math.Round(result, 0) == 181f);
55+
Assert.AreEqual(181, (int)System.Math.Round(result, 0));
5656
}
5757

5858

0 commit comments

Comments
 (0)