public void ShouldThrowWebFaultWhenUpdaterThrows() { MockedPackageRatingUpdater.Setup(pru => pru.UpdatePackageRatings(It.IsAny <IEnumerable <PackageVersionRatings> >())).Throws(new Exception()); TestDelegate methodThatShouldThrow = () => PackageService.UpdatePackageRatings(null, ""); ExceptionAssert.ThrowsWebFaultException <string>(methodThatShouldThrow); }
public void ShouldCallPackageRatingUpdater() { var expectedRatingAggregates = new List <PackageVersionRatings>(); PackageService.UpdatePackageRatings(expectedRatingAggregates, ""); MockedPackageRatingUpdater.Verify(pru => pru.UpdatePackageRatings(expectedRatingAggregates), Times.Once()); }