public void Has_to_return_correct_value_for_max_of_several_values(IEnumerable <decimal> values , decimal expected , string expectedName) { var calculatorValues = values.Select(v => new CalculatorValue(v)); var actualResult = SystemUnderTests.Max(calculatorValues); var expectedResult = new CalculatorValue(expected, expectedName); Assert.AreEqual(expectedResult.Value, actualResult.Value); Assert.AreEqual(expectedResult.Name, actualResult.Name); }
public void Has_to_return_correct_value_for_max_of_two_values(decimal valueX, decimal valueY, decimal expected) { var calculatorValueX = new CalculatorValue(valueX, nameof(valueX)); var calculatorValueY = new CalculatorValue(valueY, nameof(valueY)); var expectedResult = new CalculatorValue(expected, $"{nameof(SystemUnderTests.Max)}: " + $"{expected} of values: {valueX}, {valueY}."); var actualResult = SystemUnderTests.Max(calculatorValueX, calculatorValueY); Assert.AreEqual(expectedResult.Value, actualResult.Value); Assert.AreEqual(expectedResult.Name, actualResult.Name); }