public void Attend_TheAttendanceAlreadyExist_ReturnBadRequest()
        {
            _mockRepository.Setup(r => r.GetAttendenceExistInDb(userId, gigId)).Returns(true);
            var dto = new AttendenceDto {
                GigId = gigId
            };

            var result = _controller.Attend(dto);

            result.Should().BeOfType <BadRequestErrorMessageResult>();
        }
        public void Attend_CalledCorrectly_AddAnAttendance()
        {
            var gig = new Gig(_user.Id, "-", DateTime.Now.AddDays(1), _genre.Id);

            _context.Gigs.Add(gig);
            _context.SaveChanges();
            var dto = new AttendenceDto {
                GigId = _context.Gigs.First().Id
            };

            _controller.Attend(dto);

            _context.Attendences.Should().HaveCount(1);
        }
        public void Attend_UserAttendingAGigForWhichHeHasAnAttendence_ShouldReturnBadRequest()
        {
            //Attendence attendence = new Attendence { AttendeeId = _userId };
            //Setting Attendece object with userId is not required. Since we perform setup on repository method
            //and testing controller, not the repository

            Attendence attendence = new Attendence(); //this will be enough

            //This simply means that when GetAttendece is called, it will return Attendece object
            _mockRepositoy.Setup(g => g.GetAttendence(_userId, 1)).Returns(attendence);

            var result = _controller.Attend(new AttendeceDto()
            {
                GigId = 1
            });

            result.Should().BeOfType <BadRequestErrorMessageResult>();
        }