public void SetOffersAsInactiveErrorThrowsUp() { Mock <IDal> db = new Mock <IDal>(); db.Setup(x => x.ExecuteNonQuery(It.IsAny <string>())).Throws(new Exception("Error test")); AllegroOfferDetailsFetcher fetcher = new AllegroOfferDetailsFetcher(10); Exception ex = Assert.Throws <Exception>(() => fetcher.SetOfferAsInActive(db.Object, new Offer())); Assert.That(ex.Message, Contains.Substring("Error test")); }
public void ExceuteUpdateOfferStatusQueries() { Mock <IDal> db = new Mock <IDal>(); AllegroOfferDetailsFetcher fetcher = new AllegroOfferDetailsFetcher(10); fetcher.SetOfferAsProcessed(db.Object, new Offer()); fetcher.SetOfferAsUnprocessed(db.Object, new Offer()); fetcher.SetOfferAsInActive(db.Object, new Offer()); fetcher.SetOffersAsInProcess(db.Object, new List <Offer>() { new Offer() }); }