Пример #1
0
        public void ShouldChangeSharesNumber()
        {
            // Arrange
            SalesService salesService = new SalesService(
                this.operationTableRepository,
                this.balanceTableRepository,
                this.blockedMoneyTableRepository,
                this.sharesNumberTableRepository,
                this.blockedSharesNumberTableRepository);
            var sharesNumber = new SharesNumberEntity()
            {
                Id     = 4,
                Number = 34
            };
            int newNumber = 45;

            // Act
            bool flag = salesService.ChangeSharesNumber(sharesNumber, newNumber);

            // Assert
            this.sharesNumberTableRepository.Received(1).ChangeNumber(sharesNumber.Id, newNumber);
            this.sharesNumberTableRepository.Received(1).SaveChanges();
            if (!flag)
            {
                throw new ArgumentException("The flag is false");
            }
        }