コード例 #1
0
        public void ShouldGetNegativeBalances()
        {
            // Arrange
            reportsService = new ReportsService(
                operationTableRepository: this.operationTableRepository,
                sharesNumberTableRepository: this.sharesNumberTableRepository,
                balanceTableRepository: this.balanceTableRepository,
                shareTableRepository: this.shareTableRepository,
                clientTableRepository: this.clientTableRepository);

            // Act
            var negativeBalances = reportsService.GetNegativeBalances();

            // Assert
            this.balanceTableRepository.Received(1).GetNegativeBalances();
            foreach (var negativeBalance in negativeBalances)
            {
                if (negativeBalance.Amount >= 0)
                {
                    throw new ArgumentException("Amount in result item is not negative");
                }
            }
        }