public void ShouldThrowExceptionCantFindShares() { var sharesTableRepository = Substitute.For <ISharesTableRepository>(); sharesTableRepository.ContainsById(Arg.Is <int>(1)).Returns(false); SharesService sharesService = new SharesService(sharesTableRepository); var shares = sharesService.GetShares(1); }
public void ShouldGetSharesInfo() { var sharesTableRepository = Substitute.For <ISharesTableRepository>(); sharesTableRepository.ContainsById(Arg.Is <int>(12)).Returns(true); SharesService sharesService = new SharesService(sharesTableRepository); var shares = sharesService.GetShares(12); sharesTableRepository.Received(1).Get(12); }