예제 #1
0
        public void ShouldThrowWebFaultWhenUpdaterThrows()
        {
            MockedPackageRatingUpdater.Setup(pru => pru.UpdatePackageRatings(It.IsAny <IEnumerable <PackageVersionRatings> >())).Throws(new Exception());

            TestDelegate methodThatShouldThrow = () => PackageService.UpdatePackageRatings(null, "");

            ExceptionAssert.ThrowsWebFaultException <string>(methodThatShouldThrow);
        }
예제 #2
0
        public void ShouldCallPackageRatingUpdater()
        {
            var expectedRatingAggregates = new List <PackageVersionRatings>();

            PackageService.UpdatePackageRatings(expectedRatingAggregates, "");

            MockedPackageRatingUpdater.Verify(pru => pru.UpdatePackageRatings(expectedRatingAggregates), Times.Once());
        }