Exemple #1
0
 public StockEntity GetStockByName(string stockName)
 {
     if (!stockTableRepository.ContainsByName(stockName))
     {
         throw new ArgumentException($"Can`t get stock by this name = {stockName}.");
     }
     return(stockTableRepository.GetByName(stockName));
 }
        public void ShouldThrowExceptionIfCantFindStockByName()
        {
            //Arrange
            stockTableRepository.ContainsByName(Arg.Is <string>("Unit tests")).Returns(false);

            //Act
            var stocks = stockService.GetStockByName("Unit tests");
        }