public async Task ReturnCorrectViewModel()
        {
            var sut    = new DeleteQueryHandler(Context);
            var result = await sut.Handle(new DeleteQuery { VolunteerTaskId = VolunteerTaskId });

            Assert.IsType <DeleteViewModel>(result);
        }
        public async Task ReturnCorrectViewModel()
        {
            var sut = new DeleteQueryHandler(Context);
            var result = await sut.Handle(new DeleteQuery { TaskId = TaskId });

            Assert.IsType<DeleteViewModel>(result);
        }
        public async Task ReturnCorrectData()
        {
            var sut    = new DeleteQueryHandler(Context);
            var result = await sut.Handle(new DeleteQuery { VolunteerTaskId = VolunteerTaskId });

            Assert.Equal(result.Id, volunteerTask.Id);
            Assert.Equal(result.OrganizationId, volunteerTask.Event.Campaign.ManagingOrganizationId);
            Assert.Equal(result.CampaignId, volunteerTask.Event.CampaignId);
            Assert.Equal(result.CampaignName, volunteerTask.Event.Campaign.Name);
            Assert.Equal(result.EventId, volunteerTask.Event.Id);
            Assert.Equal(result.EventName, volunteerTask.Event.Name);
            Assert.Equal(result.Name, volunteerTask.Name);
            Assert.Equal(result.StartDateTime, volunteerTask.StartDateTime);
            Assert.Equal(result.EndDateTime, volunteerTask.EndDateTime);
        }
        public async Task ReturnCorrectData()
        {
            var sut = new DeleteQueryHandler(Context);
            var result = await sut.Handle(new DeleteQuery { TaskId = TaskId });

            Assert.Equal(result.Id, task.Id);
            Assert.Equal(result.OrganizationId, task.Event.Campaign.ManagingOrganizationId);
            Assert.Equal(result.CampaignId, task.Event.CampaignId);
            Assert.Equal(result.CampaignName, task.Event.Campaign.Name);
            Assert.Equal(result.EventId, task.Event.Id);
            Assert.Equal(result.EventName, task.Event.Name);
            Assert.Equal(result.Name, task.Name);
            Assert.Equal(result.StartDateTime, task.StartDateTime);
            Assert.Equal(result.EndDateTime, task.EndDateTime);
        }
Esempio n. 5
0
        public async Task ReturnCorrectViewModel()
        {
            const int eventId = 1;

            Context.Events.Add(new Event
            {
                Id = eventId,
                Campaign = new Campaign { ManagingOrganization = new Organization() }
            });
            Context.SaveChanges();

            var sut = new DeleteQueryHandler(Context);
            var result = await sut.Handle(new DeleteQuery { EventId = eventId });

            Assert.IsType<DeleteViewModel>(result);
        }
Esempio n. 6
0
        public async Task ReturnCorrectData()
        {
            var @event = new Event { Id = 1, Campaign = new Campaign { Id = 1, Name = "CampaignName", ManagingOrganization = new Organization { Id = 1 }}};
            Context.Events.Add(@event);
            Context.SaveChanges();

            var sut = new DeleteQueryHandler(Context);
            var result = await sut.Handle(new DeleteQuery { EventId = @event.Id });

            Assert.Equal(result.Id, @event.Id);
            Assert.Equal(result.Name, @event.Name);
            Assert.Equal(result.CampaignId, @event.Campaign.Id);
            Assert.Equal(result.CampaignName, @event.Campaign.Name);
            Assert.Equal(result.OrganizationId, @event.Campaign.ManagingOrganization.Id);
            Assert.Equal(result.StartDateTime, @event.StartDateTime);
            Assert.Equal(result.EndDateTime, @event.EndDateTime);
        }
Esempio n. 7
0
        public async Task ReturnCorrectViewModel()
        {
            const int eventId = 1;

            Context.Events.Add(new Event
            {
                Id       = eventId,
                Campaign = new Campaign {
                    ManagingOrganization = new Organization()
                }
            });
            Context.SaveChanges();

            var sut    = new DeleteQueryHandler(Context);
            var result = await sut.Handle(new DeleteQuery { EventId = eventId });

            Assert.IsType <DeleteViewModel>(result);
        }
Esempio n. 8
0
        public async Task ReturnCorrectData()
        {
            var @event = new Event {
                Id = 1, Campaign = new Campaign {
                    Id = 1, Name = "CampaignName", ManagingOrganization = new Organization {
                        Id = 1
                    }
                }
            };

            Context.Events.Add(@event);
            Context.SaveChanges();

            var sut    = new DeleteQueryHandler(Context);
            var result = await sut.Handle(new DeleteQuery { EventId = @event.Id });

            Assert.Equal(result.Id, @event.Id);
            Assert.Equal(result.Name, @event.Name);
            Assert.Equal(result.CampaignId, @event.Campaign.Id);
            Assert.Equal(result.CampaignName, @event.Campaign.Name);
            Assert.Equal(result.OrganizationId, @event.Campaign.ManagingOrganization.Id);
            Assert.Equal(result.StartDateTime, @event.StartDateTime);
            Assert.Equal(result.EndDateTime, @event.EndDateTime);
        }