예제 #1
0
        public void CalculateProfitsWithInvalidInputs(decimal[] stockPrices, Type exceptionType)
        {
            var profitCalculator = new ProfitCalculator();
            var exception        = Record.Exception(() => profitCalculator.GetMaximumProfit(stockPrices));

            exception.Should().BeOfType(exceptionType);
        }
예제 #2
0
        public void CalculateProfits(decimal[] stockPrices, decimal optimalProfit)
        {
            var profitCalculator = new ProfitCalculator();
            var profit           = profitCalculator.GetMaximumProfit(stockPrices);

            profit.Should().Be(optimalProfit);
        }