Beispiel #1
0
        public void GetGigUserAttending_ArtistHasFutureAttending_ShouldBeReturned()
        {
            string userId = "1";
            var    gig    = new Gig()
            {
                DateTime = DateTime.Now.AddDays(1), ArtistId = userId
            };

            var attendance = new Attendance()
            {
                Gigs = gig, AttendeeId = userId
            };

            mockAtttendace.SetSource(new[] { attendance });

            var gigs = _gigRepository.GetGigUserAttending(userId);

            gigs.Should().Contain(gig);
        }
Beispiel #2
0
        public ActionResult Attending()
        {
            var userId = User.Identity.GetUserId();

            var viewModel = new GigsViewModel()
            {
                UpcomingGigs = _gigRepository.GetGigUserAttending(userId),
                ShowActions  = true,
                Heading      = "Gigs I'm Attending",
                Attendances  = _attendanceRepository.GetFutureAttendances(userId).ToLookup(a => a.GigId),
            };

            return(View("Gigs", viewModel));
        }