public async Task SetUserSkillsToNull_WhenAppUserIsNotNull_AndAppUserseAssociatedSkillsIsNull_AndEventIsNotNullAndEventsCampaignIsUnlocked() { var options = this.CreateNewContextOptions(); const int eventId = 1; const string userId = "asdfasdf"; var appUser = new ApplicationUser() { Id = userId, AssociatedSkills = null }; var message = new ShowEventQuery() { EventId = eventId, User = new ClaimsPrincipal() }; var userManager = CreateUserManagerMock(); userManager.Setup(x => x.GetUserId(message.User)).Returns(appUser.Id); using (var context = new AllReadyContext(options)) { context.Users.Add(appUser); context.Events.Add(CreateAllReadyEventWithTasks(message.EventId, appUser)); await context.SaveChangesAsync(); } using (var context = new AllReadyContext(options)) { var sut = new ShowEventQueryHandler(context, userManager.Object); var eventViewModel = sut.Handle(message); eventViewModel.UserSkills.ShouldBeEmpty(); } }
public async Task InvokeGetUserIdWithTheCorrectUser_WhenEventIsNotNullAndEventsCampaignIsUnlocked() { var options = this.CreateNewContextOptions(); const int eventId = 1; const string userId = "1"; var message = new ShowEventQuery { EventId = eventId, User = new ClaimsPrincipal() }; var userManager = CreateUserManagerMock(); userManager.Setup(x => x.GetUserId(It.IsAny <ClaimsPrincipal>())).Returns(userId); using (var context = new AllReadyContext(options)) { context.Events.Add(new Models.Event { Id = eventId, Campaign = new Campaign { Locked = false } }); context.Users.Add(new ApplicationUser { Id = userId }); await context.SaveChangesAsync(); } using (var context = new AllReadyContext(options)) { var sut = new ShowEventQueryHandler(context, userManager.Object); sut.Handle(message); userManager.Verify(x => x.GetUserId(message.User), Times.Once); } }
public void SetIsUserVolunteerdForEventToTrue_WhenThereAreEventSignupsForTheEventAndTheUser_AndEventIsNotNullAndEventsCampaignIsUnlocked() { var appUser = new ApplicationUser() { Id = "asdfasfd" }; var message = new ShowEventQuery() { EventId = 1, User = new ClaimsPrincipal() }; var dataAccess = new Mock <IAllReadyDataAccess>(); var userManager = CreateUserManagerMock(); userManager.Setup(x => x.GetUserId(message.User)).Returns(appUser.Id); dataAccess.Setup(x => x.GetUser(appUser.Id)).Returns(appUser); dataAccess.Setup(x => x.GetEvent(message.EventId)).Returns(CreateAllReadyEventWithTasks(message.EventId, appUser)); dataAccess.Setup(x => x.GetEventSignups(message.EventId, appUser.Id)).Returns(new List <EventSignup>() { new EventSignup() }); var sut = new ShowEventQueryHandler(dataAccess.Object, userManager.Object); var eventViewModel = sut.Handle(message); Assert.True(eventViewModel.IsUserVolunteeredForEvent); }
public void SetTasksToListOfTaskViewModelForAnyTasksWhereTheUserHasNotVolunteeredInAscendingOrderByTaskStartDateTime_WhenThereAreNoEventSignupsForTheEventAndTheUser_AndEventIsNotNullAndEventsCampaignIsUnlocked() { var appUser = new ApplicationUser() { Id = "asdfasfd" }; var message = new ShowEventQuery() { EventId = 1, User = new ClaimsPrincipal() }; var dataAccess = new Mock <IAllReadyDataAccess>(); var userManager = CreateUserManagerMock(); userManager.Setup(x => x.GetUserId(message.User)).Returns(appUser.Id); dataAccess.Setup(x => x.GetUser(appUser.Id)).Returns(appUser); var allReadyEvent = CreateAllReadyEventWithTasks(message.EventId, appUser); dataAccess.Setup(x => x.GetEvent(message.EventId)).Returns(allReadyEvent); dataAccess.Setup(x => x.GetEventSignups(message.EventId, appUser.Id)).Returns(new List <EventSignup>()); var sut = new ShowEventQueryHandler(dataAccess.Object, userManager.Object); var eventViewModel = sut.Handle(message); Assert.Equal(allReadyEvent.Tasks.Where(x => !x.AssignedVolunteers.Any(v => v.User.Id.Equals(appUser.Id))).Count(), eventViewModel.Tasks.Count); var previousDateTime = DateTimeOffset.MinValue; foreach (var userTask in eventViewModel.Tasks) { Assert.True(userTask.StartDateTime > previousDateTime); previousDateTime = userTask.StartDateTime; } }
public void SetsEventSignupViewModel_WithTheCorrectData() { var appUser = new ApplicationUser() { Id = "asdfasasdfaf", Email = "*****@*****.**", FirstName = "Foo", LastName = "Bar", PhoneNumber = "555-555-5555", }; var message = new ShowEventQuery() { EventId = 1, User = new ClaimsPrincipal() }; var dataAccess = new Mock <IAllReadyDataAccess>(); var userManager = CreateUserManagerMock(); userManager.Setup(x => x.GetUserId(message.User)).Returns(appUser.Id); dataAccess.Setup(x => x.GetUser(appUser.Id)).Returns(appUser); dataAccess.Setup(x => x.GetEvent(message.EventId)).Returns(CreateAllReadyEventWithTasks(message.EventId, appUser)); var sut = new ShowEventQueryHandler(dataAccess.Object, userManager.Object); var eventViewModel = sut.Handle(message); Assert.Equal(message.EventId, eventViewModel.SignupModel.EventId); Assert.Equal(appUser.Id, eventViewModel.SignupModel.UserId); Assert.Equal($"{appUser.FirstName} {appUser.LastName}", eventViewModel.SignupModel.Name); Assert.Equal(appUser.Email, eventViewModel.SignupModel.PreferredEmail); Assert.Equal(appUser.PhoneNumber, eventViewModel.SignupModel.PreferredPhoneNumber); }
public void InvokeGetEventSignupsWithCorrectParameters_WhenEventIsNotNullAndEventsCampaignIsUnlocked() { const string userId = "1"; var message = new ShowEventQuery { User = new ClaimsPrincipal() }; var @event = new Models.Event { Campaign = new Campaign { Locked = false } }; var dataAccess = new Mock <IAllReadyDataAccess>(); dataAccess.Setup(x => x.GetEvent(It.IsAny <int>())).Returns(@event); dataAccess.Setup(x => x.GetUser(It.IsAny <string>())).Returns(new ApplicationUser()); var userManager = CreateUserManagerMock(); userManager.Setup(x => x.GetUserId(It.IsAny <ClaimsPrincipal>())).Returns(userId); var sut = new ShowEventQueryHandler(dataAccess.Object, userManager.Object); sut.Handle(message); dataAccess.Verify(x => x.GetEventSignups(@event.Id, userId), Times.Once); }
public async Task SetTasksToListOfTaskViewModelForAnyTasksWhereTheUserHasNotVolunteeredInAscendingOrderByTaskStartDateTime_AndEventIsNotNullAndEventsCampaignIsUnlocked() { var options = CreateNewContextOptions(); const int eventId = 1; const string userId = "asdfasdf"; var appUser = new ApplicationUser { Id = userId }; var message = new ShowEventQuery { EventId = eventId, UserId = userId }; var allReadyEvent = CreateAllReadyEventWithTasks(message.EventId, appUser); using (var context = new AllReadyContext(options)) { context.Users.Add(appUser); context.Events.Add(allReadyEvent); await context.SaveChangesAsync(); } using (var context = new AllReadyContext(options)) { var sut = new ShowEventQueryHandler(context); var eventViewModel = await sut.Handle(message); Assert.Equal(allReadyEvent.Tasks.Where(x => !x.AssignedVolunteers.Any(v => v.User.Id.Equals(appUser.Id))).Count(), eventViewModel.Tasks.Count); var previousDateTime = DateTimeOffset.MinValue; foreach (var userTask in eventViewModel.Tasks) { Assert.True(userTask.StartDateTime > previousDateTime); previousDateTime = userTask.StartDateTime; } } }
public async Task SetsTaskSignupViewModel_WithTheCorrectData() { var options = CreateNewContextOptions(); var appUser = new ApplicationUser { Id = "asdfasasdfaf", Email = "*****@*****.**", FirstName = "Foo", LastName = "Bar", PhoneNumber = "555-555-5555", }; var message = new ShowEventQuery { EventId = 1, UserId = appUser.Id }; using (var context = new AllReadyContext(options)) { context.Users.Add(appUser); context.Events.Add(CreateAllReadyEventWithTasks(message.EventId, appUser)); await context.SaveChangesAsync(); } using (var context = new AllReadyContext(options)) { var sut = new ShowEventQueryHandler(context); var eventViewModel = await sut.Handle(message); Assert.Equal(message.EventId, eventViewModel.SignupModel.EventId); Assert.Equal(appUser.Id, eventViewModel.SignupModel.UserId); Assert.Equal($"{appUser.FirstName} {appUser.LastName}", eventViewModel.SignupModel.Name); } }
public async Task ReturnNullWhenEventsCampaignIsLocked() { var options = CreateNewContextOptions(); const int eventId = 1; var message = new ShowEventQuery { EventId = eventId }; using (var context = new AllReadyContext(options)) { context.Events.Add(new Models.Event { Id = eventId, Campaign = new Campaign { Locked = true } }); await context.SaveChangesAsync(); } using (var context = new AllReadyContext(options)) { var sut = new ShowEventQueryHandler(context); var result = await sut.Handle(message); result.ShouldBeNull(); } }
public void SetsEventSignupViewModel_WithTheCorrectData() { var appUser = new ApplicationUser() { Id = "asdfasasdfaf", Email = "*****@*****.**", FirstName = "Foo", LastName = "Bar", PhoneNumber = "555-555-5555", }; var message = new ShowEventQuery() { EventId = 1, User = new ClaimsPrincipal() }; var dataAccess = new Mock<IAllReadyDataAccess>(); var userManager = CreateUserManagerMock(); userManager.Setup(x => x.GetUserId(message.User)).Returns(appUser.Id); dataAccess.Setup(x => x.GetUser(appUser.Id)).Returns(appUser); dataAccess.Setup(x => x.GetEvent(message.EventId)).Returns(CreateAllReadyEventWithTasks(message.EventId, appUser)); var sut = new ShowEventQueryHandler(dataAccess.Object, userManager.Object); var eventViewModel = sut.Handle(message); Assert.Equal(message.EventId, eventViewModel.SignupModel.EventId); Assert.Equal(appUser.Id, eventViewModel.SignupModel.UserId); Assert.Equal($"{appUser.FirstName} {appUser.LastName}", eventViewModel.SignupModel.Name); Assert.Equal(appUser.Email, eventViewModel.SignupModel.PreferredEmail); Assert.Equal(appUser.PhoneNumber, eventViewModel.SignupModel.PreferredPhoneNumber); }
public async Task SetUserSkillsToNull_WhenAppUserIsNull_AndEventIsNotNullAndEventsCampaignIsUnlocked() { var options = CreateNewContextOptions(); const int eventId = 1; const string userId = "asdfasdf"; var appUser = new ApplicationUser { Id = userId }; var message = new ShowEventQuery { EventId = eventId, UserId = userId }; using (var context = new AllReadyContext(options)) { context.Users.Add(appUser); context.Events.Add(CreateAllReadyEventWithTasks(message.EventId, appUser)); await context.SaveChangesAsync(); } using (var context = new AllReadyContext(options)) { var sut = new ShowEventQueryHandler(context); var eventViewModel = await sut.Handle(message); eventViewModel.UserSkills.ShouldBeEmpty(); } }
public void ReturnNullWhenEventsCampaignIslocked() { var dataAccess = new Mock<IAllReadyDataAccess>(); dataAccess.Setup(x => x.GetEvent(It.IsAny<int>())).Returns(new Models.Event { Campaign = new Campaign { Locked = true }}); var sut = new ShowEventQueryHandler(dataAccess.Object, null); var result = sut.Handle(new ShowEventQuery()); result.ShouldBeNull(); }
public void ReturnNullWhenEventIsNotFound() { var dataAccess = new Mock<IAllReadyDataAccess>(); dataAccess.Setup(x => x.GetEvent(It.IsAny<int>())).Returns<Models.Event>(null); var sut = new ShowEventQueryHandler(dataAccess.Object, null); var result = sut.Handle(new ShowEventQuery()); result.ShouldBeNull(); }
public void InvokeGetEventWithTheCorrectEventId() { var message = new ShowEventQuery { EventId = 1 }; var dataAccess = new Mock<IAllReadyDataAccess>(); var sut = new ShowEventQueryHandler(dataAccess.Object, null); sut.Handle(message); dataAccess.Verify(x => x.GetEvent(message.EventId), Times.Once); }
public void WhenEventNotFoundReturnsNull() { var showEventCommand = new ShowEventQuery { EventId = 1 }; var dataAccess = new Mock<IAllReadyDataAccess>(); dataAccess.Setup(x => x.GetEvent(showEventCommand.EventId)) .Returns<Models.Event>(null); var sut = new ShowEventQueryHandler(dataAccess.Object, null, null); var viewModel = sut.Handle(showEventCommand); viewModel.ShouldBeNull(); }
public void ReturnNullWhenEventIsNotFound() { var dataAccess = new Mock <IAllReadyDataAccess>(); dataAccess.Setup(x => x.GetEvent(It.IsAny <int>())).Returns <Models.Event>(null); var sut = new ShowEventQueryHandler(dataAccess.Object, null); var result = sut.Handle(new ShowEventQuery()); result.ShouldBeNull(); }
public void WhenEventCampaignIsLockedReturnsNull() { var showEventCommand = new ShowEventQuery { EventId = 1 }; var mockDbAccess = new Mock<IAllReadyDataAccess>(); var expectedEvent = new Models.Event { Campaign = new Campaign { Locked = true } }; mockDbAccess.Setup(x => x.GetEvent(showEventCommand.EventId)) .Returns(expectedEvent); var sut = new ShowEventQueryHandler(mockDbAccess.Object, null, null); var viewModel = sut.Handle(showEventCommand); viewModel.ShouldBeNull(); }
public void HappyPath() { var showEventCommand = new ShowEventQuery { EventId = 1, User = ClaimsPrincipal.Current }; var mockDbAccess = new Mock<IAllReadyDataAccess>(); var expectedEvent = new Models.Event { Campaign = new Campaign { Locked = false } }; mockDbAccess.Setup(x => x.GetEvent(showEventCommand.EventId)) .Returns(expectedEvent); var sut = new ShowEventQueryHandler(mockDbAccess.Object, null, null); var viewModel = sut.Handle(showEventCommand); viewModel.ShouldNotBeNull(); }
public void InvokeGetEventWithTheCorrectEventId() { var message = new ShowEventQuery { EventId = 1 }; var dataAccess = new Mock <IAllReadyDataAccess>(); var sut = new ShowEventQueryHandler(dataAccess.Object, null); sut.Handle(message); dataAccess.Verify(x => x.GetEvent(message.EventId), Times.Once); }
public void WhenEventNotFoundReturnsNull() { var showEventCommand = new ShowEventQuery { EventId = 1 }; var dataAccess = new Mock <IAllReadyDataAccess>(); dataAccess.Setup(x => x.GetEvent(showEventCommand.EventId)) .Returns <Models.Event>(null); var sut = new ShowEventQueryHandler(dataAccess.Object); var viewModel = sut.Handle(showEventCommand); viewModel.ShouldBeNull(); }
public void InvokeGetUserIdWithTheCorrectUser_WhenEventIsNotNullAndEventsCampaignIsUnlocked() { var message = new ShowEventQuery { User = new ClaimsPrincipal() }; var dataAccess = new Mock<IAllReadyDataAccess>(); dataAccess.Setup(x => x.GetEvent(It.IsAny<int>())).Returns(new Models.Event { Campaign = new Campaign { Locked = false }}); dataAccess.Setup(x => x.GetUser(It.IsAny<string>())).Returns(new ApplicationUser()); var userManager = CreateUserManagerMock(); var sut = new ShowEventQueryHandler(dataAccess.Object, userManager.Object); sut.Handle(message); userManager.Verify(x => x.GetUserId(message.User), Times.Once); }
public void ReturnNullWhenEventsCampaignIslocked() { var dataAccess = new Mock <IAllReadyDataAccess>(); dataAccess.Setup(x => x.GetEvent(It.IsAny <int>())).Returns(new Models.Event { Campaign = new Campaign { Locked = true } }); var sut = new ShowEventQueryHandler(dataAccess.Object, null); var result = sut.Handle(new ShowEventQuery()); result.ShouldBeNull(); }
public void InvokeGetEventSignupsWithCorrectParameters_WhenEventIsNotNullAndEventsCampaignIsUnlocked() { const string userId = "1"; var message = new ShowEventQuery { User = new ClaimsPrincipal() }; var @event = new Models.Event { Campaign = new Campaign { Locked = false }}; var dataAccess = new Mock<IAllReadyDataAccess>(); dataAccess.Setup(x => x.GetEvent(It.IsAny<int>())).Returns(@event); dataAccess.Setup(x => x.GetUser(It.IsAny<string>())).Returns(new ApplicationUser()); var userManager = CreateUserManagerMock(); userManager.Setup(x => x.GetUserId(It.IsAny<ClaimsPrincipal>())).Returns(userId); var sut = new ShowEventQueryHandler(dataAccess.Object, userManager.Object); sut.Handle(message); dataAccess.Verify(x => x.GetEventSignups(@event.Id, userId), Times.Once); }
public void HappyPath() { var showEventCommand = new ShowEventQuery { EventId = 1, User = ClaimsPrincipal.Current }; var mockDbAccess = new Mock <IAllReadyDataAccess>(); var expectedEvent = new Models.Event { Campaign = new Campaign { Locked = false } }; mockDbAccess.Setup(x => x.GetEvent(showEventCommand.EventId)) .Returns(expectedEvent); var sut = new ShowEventQueryHandler(mockDbAccess.Object); var viewModel = sut.Handle(showEventCommand); viewModel.ShouldNotBeNull(); }
public void WhenEventCampaignIsLockedReturnsNull() { var showEventCommand = new ShowEventQuery { EventId = 1 }; var mockDbAccess = new Mock <IAllReadyDataAccess>(); var expectedEvent = new Models.Event { Campaign = new Campaign { Locked = true } }; mockDbAccess.Setup(x => x.GetEvent(showEventCommand.EventId)) .Returns(expectedEvent); var sut = new ShowEventQueryHandler(mockDbAccess.Object); var viewModel = sut.Handle(showEventCommand); viewModel.ShouldBeNull(); }
public async Task ReturnNullWhenEventIsNotFound() { var options = CreateNewContextOptions(); var message = new ShowEventQuery { EventId = 1 }; using (var context = new AllReadyContext(options)) { // add nothing //await context.SaveChangesAsync(); } using (var context = new AllReadyContext(options)) { var sut = new ShowEventQueryHandler(context); var result = await sut.Handle(message); result.ShouldBeNull(); } }
public void SetUserSkillsToNull_WhenAppUserIsNull_AndEventIsNotNullAndEventsCampaignIsUnlocked() { var appUser = new ApplicationUser() { Id = "asdfasdf" }; var message = new ShowEventQuery() { EventId = 1, User = new ClaimsPrincipal() }; var dataAccess = new Mock <IAllReadyDataAccess>(); var userManager = CreateUserManagerMock(); userManager.Setup(x => x.GetUserId(message.User)).Returns("adfasdfaf"); dataAccess.Setup(x => x.GetEvent(message.EventId)).Returns(CreateAllReadyEventWithTasks(message.EventId, appUser)); var sut = new ShowEventQueryHandler(dataAccess.Object, userManager.Object); var eventViewModel = sut.Handle(message); Assert.Null(eventViewModel.UserSkills); }
public void InvokeGetUserIdWithTheCorrectUser_WhenEventIsNotNullAndEventsCampaignIsUnlocked() { var message = new ShowEventQuery { User = new ClaimsPrincipal() }; var dataAccess = new Mock <IAllReadyDataAccess>(); dataAccess.Setup(x => x.GetEvent(It.IsAny <int>())).Returns(new Models.Event { Campaign = new Campaign { Locked = false } }); dataAccess.Setup(x => x.GetUser(It.IsAny <string>())).Returns(new ApplicationUser()); var userManager = CreateUserManagerMock(); var sut = new ShowEventQueryHandler(dataAccess.Object, userManager.Object); sut.Handle(message); userManager.Verify(x => x.GetUserId(message.User), Times.Once); }
public async Task SetsTaskSignupViewModel_WithTheCorrectData() { var options = this.CreateNewContextOptions(); var appUser = new ApplicationUser() { Id = "asdfasasdfaf", Email = "*****@*****.**", FirstName = "Foo", LastName = "Bar", PhoneNumber = "555-555-5555", }; var message = new ShowEventQuery() { EventId = 1, User = new ClaimsPrincipal() }; var userManager = CreateUserManagerMock(); userManager.Setup(x => x.GetUserId(message.User)).Returns(appUser.Id); using (var context = new AllReadyContext(options)) { context.Users.Add(appUser); context.Events.Add(CreateAllReadyEventWithTasks(message.EventId, appUser)); await context.SaveChangesAsync(); } using (var context = new AllReadyContext(options)) { var sut = new ShowEventQueryHandler(context, userManager.Object); var eventViewModel = sut.Handle(message); Assert.Equal(message.EventId, eventViewModel.SignupModel.EventId); Assert.Equal(appUser.Id, eventViewModel.SignupModel.UserId); Assert.Equal($"{appUser.FirstName} {appUser.LastName}", eventViewModel.SignupModel.Name); Assert.Equal(appUser.Email, eventViewModel.SignupModel.PreferredEmail); Assert.Equal(appUser.PhoneNumber, eventViewModel.SignupModel.PreferredPhoneNumber); } }
public void SetUserSkillsToNull_WhenAppUserIsNotNull_AndAppUserseAssociatedSkillsIsNull_AndEventIsNotNullAndEventsCampaignIsUnlocked() { var appUser = new ApplicationUser() { Id = "asdfasfd", AssociatedSkills = null }; var message = new ShowEventQuery() { EventId = 1, User = new ClaimsPrincipal() }; var dataAccess = new Mock<IAllReadyDataAccess>(); var userManager = CreateUserManagerMock(); userManager.Setup(x => x.GetUserId(message.User)).Returns(appUser.Id); dataAccess.Setup(x => x.GetUser(appUser.Id)).Returns(appUser); dataAccess.Setup(x => x.GetEvent(message.EventId)).Returns(CreateAllReadyEventWithTasks(message.EventId, appUser)); var sut = new ShowEventQueryHandler(dataAccess.Object, userManager.Object); var eventViewModel = sut.Handle(message); Assert.Null(eventViewModel.UserSkills); }
public void SetIsUserVolunteerdForEventToFalse_WhenThereAreNoEventSignupsForTheEventAndTheUser_AndEventIsNotNullAndEventsCampaignIsUnlocked() { var appUser = new ApplicationUser() { Id = "asdfasfd" }; var message = new ShowEventQuery() { EventId = 1, User = new ClaimsPrincipal() }; var dataAccess = new Mock<IAllReadyDataAccess>(); var userManager = CreateUserManagerMock(); userManager.Setup(x => x.GetUserId(message.User)).Returns(appUser.Id); dataAccess.Setup(x => x.GetUser(appUser.Id)).Returns(appUser); dataAccess.Setup(x => x.GetEvent(message.EventId)).Returns(CreateAllReadyEventWithTasks(message.EventId, appUser)); var sut = new ShowEventQueryHandler(dataAccess.Object, userManager.Object); var eventViewModel = sut.Handle(message); Assert.False(eventViewModel.IsUserVolunteeredForEvent); }
public void SetTasksToListOfTaskViewModelForAnyTasksWhereTheUserHasNotVolunteeredInAscendingOrderByTaskStartDateTime_WhenThereAreNoEventSignupsForTheEventAndTheUser_AndEventIsNotNullAndEventsCampaignIsUnlocked() { var appUser = new ApplicationUser() { Id = "asdfasfd" }; var message = new ShowEventQuery() { EventId = 1, User = new ClaimsPrincipal() }; var dataAccess = new Mock<IAllReadyDataAccess>(); var userManager = CreateUserManagerMock(); userManager.Setup(x => x.GetUserId(message.User)).Returns(appUser.Id); dataAccess.Setup(x => x.GetUser(appUser.Id)).Returns(appUser); var allReadyEvent = CreateAllReadyEventWithTasks(message.EventId, appUser); dataAccess.Setup(x => x.GetEvent(message.EventId)).Returns(allReadyEvent); dataAccess.Setup(x => x.GetEventSignups(message.EventId, appUser.Id)).Returns(new List<EventSignup>()); var sut = new ShowEventQueryHandler(dataAccess.Object, userManager.Object); var eventViewModel = sut.Handle(message); Assert.Equal(allReadyEvent.Tasks.Where(x => !x.AssignedVolunteers.Any(v => v.User.Id.Equals(appUser.Id))).Count(), eventViewModel.Tasks.Count); var previousDateTime = DateTimeOffset.MinValue; foreach (var userTask in eventViewModel.Tasks) { Assert.True(userTask.StartDateTime > previousDateTime); previousDateTime = userTask.StartDateTime; } }