public async Task ReturnCorrectData() { var result = await sut.Handle(message); Assert.Equal(result.Id, task.Id); Assert.Equal(result.Name, task.Name); Assert.Equal(result.Description, task.Description); Assert.Equal(result.NumberOfVolunteersRequired, task.NumberOfVolunteersRequired); Assert.Equal(result.EventId, task.Event.Id); Assert.Equal(result.EventName, task.Event.Name); Assert.Equal(result.CampaignId, task.Event.CampaignId); Assert.Equal(result.CampaignName, task.Event.Campaign.Name); Assert.Equal(result.TimeZoneId, task.Event.TimeZoneId); //Assert.Equal(result.RequiredSkills, task.RequiredSkills); Assert.Equal(result.AssignedVolunteers.Count, task.AssignedVolunteers.Count); for (var i = 0; i < result.AssignedVolunteers.Count; ++i) { var resultVolunteer = result.AssignedVolunteers[i]; var expectedVolunteer = task.AssignedVolunteers[i]; Assert.Equal(resultVolunteer.UserId, expectedVolunteer.User.Id); Assert.Equal(resultVolunteer.UserName, expectedVolunteer.User.UserName); Assert.True(resultVolunteer.HasVolunteered); Assert.Equal(resultVolunteer.Name, expectedVolunteer.User.Name); Assert.Equal(resultVolunteer.PhoneNumber, expectedVolunteer.User.PhoneNumber); Assert.Equal(resultVolunteer.AssociatedSkills.Count, expectedVolunteer.User.AssociatedSkills.Count); for (var j = 0; j < resultVolunteer.AssociatedSkills.Count; ++j) { Assert.Equal(resultVolunteer.AssociatedSkills[j].Skill.HierarchicalName, resultVolunteer.AssociatedSkills[j].Skill.HierarchicalName); } } //Assert.Equal(result.AllVolunteers, task.Event.UsersSignedUp.Select(x => new VolunteerViewModel { UserId = x.User.Id, UserName = x.User.UserName, HasVolunteered = false }).ToList()); }
public async Task ReturnCorrectData() { var result = await sut.Handle(message); Assert.Equal(result.Id, task.Id); Assert.Equal(result.Name, task.Name); Assert.Equal(result.Description, task.Description); Assert.Equal(result.NumberOfVolunteersRequired, task.NumberOfVolunteersRequired); Assert.Equal(result.EventId, task.Event.Id); Assert.Equal(result.EventName, task.Event.Name); Assert.Equal(result.CampaignId, task.Event.CampaignId); Assert.Equal(result.CampaignName, task.Event.Campaign.Name); Assert.Equal(result.TimeZoneId, task.Event.TimeZoneId); //Assert.Equal(result.RequiredSkills, task.RequiredSkills); //Assert.Equal(result.AssignedVolunteers, task.AssignedVolunteers.Select(x => new VolunteerViewModel { UserId = x.User.Id, UserName = x.User.UserName, HasVolunteered = true }).ToList()); //Assert.Equal(result.AllVolunteers, task.Event.UsersSignedUp.Select(x => new VolunteerViewModel { UserId = x.User.Id, UserName = x.User.UserName, HasVolunteered = false }).ToList()); }