public void ShouldGetSharesNumbersByShare() { // Arrange reportsService = new ReportsService( operationTableRepository: this.operationTableRepository, sharesNumberTableRepository: this.sharesNumberTableRepository, balanceTableRepository: this.balanceTableRepository, shareTableRepository: this.shareTableRepository, clientTableRepository: this.clientTableRepository); int testShareId = 3; // Act var sharesNumbersByShare = reportsService.GetSharesNumberByShare(testShareId); // Assert var testOperations = this.sharesNumberTableRepository.Received(1).GetByShare(testShareId); foreach (var sharesNumber in sharesNumbersByShare) { if (sharesNumber.Share.Id != testShareId) { throw new ArgumentException("Wrong Id in result item"); } } }