public void CalculateProfitsWithInvalidInputs(decimal[] stockPrices, Type exceptionType) { var profitCalculator = new ProfitCalculator(); var exception = Record.Exception(() => profitCalculator.GetMaximumProfit(stockPrices)); exception.Should().BeOfType(exceptionType); }
public void CalculateProfits(decimal[] stockPrices, decimal optimalProfit) { var profitCalculator = new ProfitCalculator(); var profit = profitCalculator.GetMaximumProfit(stockPrices); profit.Should().Be(optimalProfit); }