public void GetSessionsByDate_InvalidDateProvided_ThrowException()
        {
            var user = new UserTO {
                Company = "CaBossDur", Email = "*****@*****.**", Id = 3, IsArchived = false, Name = "Marcel", Role = UserRole.Attendee,
            };
            var user2 = new UserTO {
                Company = "CaBossDur2", Email = "*****@*****.**", Id = 2, IsArchived = false, Name = "Jean-Luc", Role = UserRole.Attendee,
            };
            var user3 = new UserTO {
                Company = "CaBossDur3", Email = "*****@*****.**", Id = 1, IsArchived = false, Name = "Clara", Role = UserRole.Attendee,
            };

            var users = new List <UserTO>()
            {
                user, user2, user3
            };

            var sessionDay = new SessionDayTO {
                Id = 1, Date = new DateTime(2020, 02, 20), PresenceType = SessionPresenceType.AfternoonOnly
            };
            var sessionDay2 = new SessionDayTO {
                Id = 2, Date = new DateTime(2020, 02, 21), PresenceType = SessionPresenceType.MorningAfternoon
            };
            var sessionDay3 = new SessionDayTO {
                Id = 3, Date = new DateTime(2020, 02, 22), PresenceType = SessionPresenceType.OnceADay
            };

            var sessions = new List <SessionTO>
            {
                new SessionTO()
                {
                    Attendees = new List <UserTO>()
                    {
                        user, user2
                    }, Id = 1, SessionDays = new List <SessionDayTO>()
                    {
                        sessionDay, sessionDay2
                    }
                },
                new SessionTO()
                {
                    Attendees = new List <UserTO>()
                    {
                        user2
                    }, Id = 2, SessionDays = new List <SessionDayTO>()
                    {
                        sessionDay3, sessionDay2
                    }
                },
                new SessionTO()
                {
                    Attendees = new List <UserTO>()
                    {
                        user2, user3
                    }, Id = 3, SessionDays = new List <SessionDayTO>()
                    {
                        sessionDay, sessionDay3
                    }
                },
            };

            var mockUnitOfWork = new Mock <IRSUnitOfWork>();

            mockUnitOfWork.Setup(u => u.SessionRepository.GetSessionsByDate(It.IsAny <DateTime>())).Returns(sessions);
            var sut = new RSAttendeeRole(mockUnitOfWork.Object);

            //ACT
            //ASSERT
            Assert.ThrowsException <ArgumentOutOfRangeException>(() => sut.GetSessionsByDate(new DateTime(30, 30, 30)));
        }
        public void GetSessionsByDate_NotExistingDateInDB_ThrowException()
        {
            var user = new UserTO {
                Company = "CaBossDur", Email = "*****@*****.**", Id = 3, IsArchived = false, Name = "Marcel", Role = UserRole.Attendee,
            };
            var user2 = new UserTO {
                Company = "CaBossDur2", Email = "*****@*****.**", Id = 2, IsArchived = false, Name = "Jean-Luc", Role = UserRole.Attendee,
            };
            var user3 = new UserTO {
                Company = "CaBossDur3", Email = "*****@*****.**", Id = 1, IsArchived = false, Name = "Clara", Role = UserRole.Attendee,
            };

            var users = new List <UserTO>()
            {
                user, user2, user3
            };

            var sessionDay = new SessionDayTO {
                Id = 1, Date = new DateTime(2020, 02, 20), PresenceType = SessionPresenceType.AfternoonOnly
            };
            var sessionDay2 = new SessionDayTO {
                Id = 2, Date = new DateTime(2020, 02, 21), PresenceType = SessionPresenceType.MorningAfternoon
            };
            var sessionDay3 = new SessionDayTO {
                Id = 3, Date = new DateTime(2020, 02, 22), PresenceType = SessionPresenceType.OnceADay
            };

            var sessions = new List <SessionTO>
            {
                new SessionTO()
                {
                    Attendees = new List <UserTO>()
                    {
                        user, user2
                    }, Id = 1, SessionDays = new List <SessionDayTO>()
                    {
                        sessionDay, sessionDay2
                    }
                },
                new SessionTO()
                {
                    Attendees = new List <UserTO>()
                    {
                        user2
                    }, Id = 2, SessionDays = new List <SessionDayTO>()
                    {
                        sessionDay3, sessionDay2
                    }
                },
                new SessionTO()
                {
                    Attendees = new List <UserTO>()
                    {
                        user2, user3
                    }, Id = 3, SessionDays = new List <SessionDayTO>()
                    {
                        sessionDay, sessionDay3
                    }
                },
            };

            var mockUnitOfWork = new Mock <IRSUnitOfWork>();
            var sut            = new RSAttendeeRole(mockUnitOfWork.Object);

            //ACT
            //ASSERT
            Assert.ThrowsException <LoggedException>(() => sut.GetSessionsByDate(new DateTime(2021, 03, 02)));
        }