public void ComplexDecimalAdd_WhenGivenDifferentFloatingTypes_ShouldReturnZeroWhenFloatIsBeyondDecimal() { //Arrange var firstValue = float.MaxValue; var secondValue = 1.2d; var thirdValue = 1.3m; var expected = 0m; //Act var actual = WeirdCalculator.ComplexDecimalAdd(firstValue, secondValue, thirdValue); //Assert Assert.AreEqual(expected, actual); }
public void ComplexDecimalAdd_WhenGivenDifferentFloatingTypes_ShouldAddIfTheyCanAllFitIntoDecimals() { //Arrange var firstValue = 1.1f; var secondValue = 1.2d; var thirdValue = 1.3m; var expected = 3.6m; //Act var actual = WeirdCalculator.ComplexDecimalAdd(firstValue, secondValue, thirdValue); //Assert Assert.AreEqual(expected, actual); }