public async Task ThrowIfGivenInviteIdDoNotExist() { var handler = new RemoveCampaignManagerInviteCommandHandler(Context); var inviteCommand = new RemoveCampaignManagerInviteCommand { InviteId = 233 }; try { await handler.Handle(inviteCommand); } catch (InvalidOperationException ex) { ex.Message.ShouldContain("Failed to find invite"); } }
public async Task ShouldBeAbleToRemoveExistingInvite() { var handler = new RemoveCampaignManagerInviteCommandHandler(Context); Context.CampaignManagerInvites.Add(new CampaignManagerInvite { Id = 233 }); Context.SaveChanges(); var inviteCommand = new RemoveCampaignManagerInviteCommand { InviteId = 233 }; await handler.Handle(inviteCommand); Context.CampaignManagerInvites.Count().ShouldBe(0); }