public void ReturnsExpectedEvents()
        {
            var eventSignups = new[]
            {
                new EventSignup
                {
                    Event = new Models.Event
                    {
                        Campaign = new Campaign
                        {
                            ManagingOrganization = new Organization
                            {
                                Id   = 1,
                                Name = "Some Organization"
                            },
                            Locked = true
                        }
                    }
                },
                new EventSignup
                {
                    Event = new Models.Event
                    {
                        Name     = "Expected Event",
                        Campaign = new Campaign
                        {
                            ManagingOrganization = new Organization
                            {
                                Id   = 1,
                                Name = "Some Organization"
                            },
                            Locked = false
                        }
                    }
                }
            };

            var mockDbAccess = new Mock <IAllReadyDataAccess>();

            var command = new GetMyEventsQuery {
                UserId = "B62AF756-809D-40B7-AA88-237E52889C45"
            };

            mockDbAccess.Setup(db => db.GetEventSignups(command.UserId)).Returns(eventSignups);

            var sut      = new GetMyEventsQueryHandler(mockDbAccess.Object);
            var response = sut.Handle(command);

            response.ShouldSatisfyAllConditions(
                () => response.Items.Count.ShouldBe(1),
                () => response.Items.First().Title.ShouldBe("Expected Event")
                );
        }
        public async Task ReturnExpectedEvents()
        {
            var userId  = "UserId1";
            var message = new GetMyEventsQuery {
                UserId = userId
            };
            var sut      = new GetMyEventsQueryHandler(Context);
            var response = await sut.Handle(message);

            Assert.True(response.CurrentEvents.First().EventId == 1 &&
                        response.FutureEvents.First().EventId == 3);
        }
        public void ReturnsExpectedEvents()
        {
            var eventSignups = new[]
            {
                new EventSignup
                {
                    Event = new Models.Event
                    {
                        Campaign = new Campaign
                        {
                            ManagingOrganization = new Organization
                            {
                                Id = 1,
                                Name = "Some Organization"
                            },
                            Locked = true
                        }
                    }
                },
                new EventSignup
                {
                    Event = new Models.Event
                    {
                        Name = "Expected Event",
                        Campaign = new Campaign
                        {
                            ManagingOrganization = new Organization
                            {
                                Id = 1,
                                Name = "Some Organization"
                            },
                            Locked = false
                        }
                    }
                }
            };

            var mockDbAccess = new Mock<IAllReadyDataAccess>();

            var command = new GetMyEventsQuery {UserId = "B62AF756-809D-40B7-AA88-237E52889C45"};
            mockDbAccess.Setup(db => db.GetEventSignups(command.UserId)).Returns(eventSignups);

            var sut = new GetMyEventsQueryHandler(mockDbAccess.Object);
            var response = sut.Handle(command);

            response.ShouldSatisfyAllConditions(
                () => response.Items.Count.ShouldBe(1),
                () => response.Items.First().Title.ShouldBe("Expected Event")
            );
        }