public void LoadRealEstateImagesByRealEstateIdShouldReturnImages() { var realEstateId = this.TestData.Select(x => x.RealEstateId).FirstOrDefault(); var expectedImagesCount = 2; var mapper = this.GetMapper(); var realEstateServices = new Mock <IRealEstateServices>(); var imageServices = new ImageServices(context, mapper, realEstateServices.Object); var actualResult = imageServices.LoadImagesAsync(realEstateId); Assert.That(actualResult.Images.Count() == expectedImagesCount, ImageCountMismatchMessage, actualResult.Images.Count(), expectedImagesCount); Assert.That(actualResult.Images.Select(x => x.RealEstateId).FirstOrDefault() == realEstateId); }