public void Call_AllMethodFromRepositoryOnce() { // Arrange var carAdsServices = new CarAdServices( this.carAdsRepoMock.Object, this.carBrandsRepoMock, this.carModelsRepoMock, this.carFeatureServicesMock, this.unitOfWorkMocked); // Act carAdsServices.GetAdById(It.IsAny <Guid>()); // Assert this.carAdsRepoMock.Verify(x => x.All, Times.Once); }
public void ReturnCarAd_WithExactSameId() { // Arrange var carAdsServices = new CarAdServices( this.carAdsRepoMock.Object, this.carBrandsRepoMock, this.carModelsRepoMock, this.carFeatureServicesMock, this.unitOfWorkMocked); // Act var actualReturnedCarAd = carAdsServices.GetAdById(this.expectedCarAd.Id); // Assert Assert.AreSame(this.expectedCarAd, actualReturnedCarAd); }