Ejemplo n.º 1
0
        public void ShouldGetSharesNumbersByClient()
        {
            // Arrange
            reportsService = new ReportsService(
                operationTableRepository: this.operationTableRepository,
                sharesNumberTableRepository: this.sharesNumberTableRepository,
                balanceTableRepository: this.balanceTableRepository,
                shareTableRepository: this.shareTableRepository,
                clientTableRepository: this.clientTableRepository);
            int testClientId = 4;

            // Act
            var sharesNumbersOfClient = reportsService.GetSharesNumberByClient(testClientId);

            // Assert
            this.sharesNumberTableRepository.Received(1).GetByClient(testClientId);
            foreach (var sharesNumber in sharesNumbersOfClient)
            {
                if (sharesNumber.Client.Id != testClientId)
                {
                    throw new ArgumentException("Wrong Id in result item");
                }
            }
        }