public void UnsubscribeFromParcel_ParcelNotFound() { long id = 123; Mock <IWebhookRepository> webMock = new Mock <IWebhookRepository>(); Mock <IParcelRepository> parcelMock = new Mock <IParcelRepository>(); IWebhookLogic webhookLogic = new WebhookLogic(mapper, webMock.Object, parcelMock.Object, NullLogger <WebhookLogic> .Instance); webMock.Setup(foo => foo.DeleteByWebhookId(id)).Throws(new ParcelNotFoundExpection()); Assert.Throws <BusinessLayerException>(() => webhookLogic.UnsubscribeFromParcel(id)); }
public void UnsubscribeFromParcel_IsOk() { long id = 123; Mock <IWebhookRepository> webMock = new Mock <IWebhookRepository>(); Mock <IParcelRepository> parcelMock = new Mock <IParcelRepository>(); webMock.Setup(foo => foo.DeleteByWebhookId(id)); IWebhookLogic webhookLogic = new WebhookLogic(mapper, webMock.Object, parcelMock.Object, NullLogger <WebhookLogic> .Instance); webhookLogic.UnsubscribeFromParcel(id); }