示例#1
0
        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");
            }
        }
示例#2
0
        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);
        }