public async void CalculateTrolley_WhenTrolleyInfoIsNull_ReturnsZero() { // Arrange var sutTrolleyCalculator = new TrolleyCalculator2(); // Act var result = await sutTrolleyCalculator.CalculateTrolley(null); // Assert result.Should().Be(0); }
public async void CalculateTrolley_WhenTrolleyInfoIsValid_ReturnsCorrectMinimumTotal(TrolleyInfo trolleyInfo, decimal expectedTotal) { // Arrange var sutTrolleyCalculator = new TrolleyCalculator2(); // Act var result = await sutTrolleyCalculator.CalculateTrolley(trolleyInfo); // Assert result.Should().Be(expectedTotal); }
public void CalculateTrolley_WhenTrolleyInfoPropertyIsNull_ThrowArgumentException(TrolleyInfo trolleyInfo) { // Arrange var sutTrolleyCalculator = new TrolleyCalculator2(); // Act Func <Task> action = async() => await sutTrolleyCalculator.CalculateTrolley(trolleyInfo); // Assert action.Should().ThrowExactlyAsync <ArgumentException>() .WithMessage("Products, Quantities and Specials properties cannot be null."); }