public void Task_GetEmployeeAppointmentsByFilter_MatchResult()
        {
            //Arrange
            var id            = 1;
            var appointmentId = 1;

            IQueryable <EmployeeAppointment> employeeAppointmentList = new List <EmployeeAppointment>()
            {
                new EmployeeAppointment()
                {
                    AppointmentId = appointmentId, Id = id
                }, new EmployeeAppointment()
                {
                    AppointmentId = 2, Id = 2
                }
            }.AsQueryable();

            EmployeeAppointmentRepositoryMock.Setup(m => m.Get(s => s.AppointmentId.Equals(appointmentId), null)).Returns(employeeAppointmentList).Verifiable();

            //Act
            var actual = EmployeeAppointmentsBusinessManager.Get(s => s.AppointmentId.Equals(appointmentId));

            //Assert
            Assert.IsInstanceOfType(actual, typeof(IQueryable <EmployeeAppointment>)); //passes
            Assert.AreEqual(appointmentId, actual.ToArray()[0].AppointmentId);         //assert that actual result was as appointmentId
            Assert.AreEqual(employeeAppointmentList.Count(), actual.Count());          //assert  count
        }
        public void Task_GetEmployeeAppointments_MatchResult()
        {
            //Arrange

            IQueryable <EmployeeAppointment> employeeAppointmentList = new List <EmployeeAppointment>()
            {
                new EmployeeAppointment()
                {
                    AppointmentId = 1, Id = 1
                }, new EmployeeAppointment()
                {
                    AppointmentId = 2, Id = 2
                }
            }.AsQueryable();

            EmployeeAppointmentRepositoryMock.Setup(m => m.Get(null, null)).Returns(employeeAppointmentList).Verifiable();

            //Act
            var actual = EmployeeAppointmentsBusinessManager.Get();

            //Assert
            Assert.IsInstanceOfType(actual, typeof(IQueryable <EmployeeAppointment>));                              //passes
            Assert.AreEqual(employeeAppointmentList.ToArray()[0].AppointmentId, actual.ToArray()[0].AppointmentId); //assert that actual result was as appointmentId
            Assert.AreEqual(employeeAppointmentList.ToArray()[0].Id, actual.ToArray()[0].Id);                       //assert that actual result was as appointmentId
            Assert.AreEqual(employeeAppointmentList.ToArray()[1].AppointmentId, actual.ToArray()[1].AppointmentId); //assert that actual result was as appointmentId
            Assert.AreEqual(employeeAppointmentList.ToArray()[1].Id, actual.ToArray()[1].Id);                       //assert that actual result was as appointmentId
        }
        public void Task_GetEmptyEmployeeAppointments_Return_EmptyList()
        {
            //Arrange

            IQueryable <EmployeeAppointment> employeeAppointmentList = new List <EmployeeAppointment>().AsQueryable();

            EmployeeAppointmentRepositoryMock.Setup(m => m.Get(null, null)).Returns(employeeAppointmentList).Verifiable();

            //Act
            var actual = EmployeeAppointmentsBusinessManager.Get();

            //Assert
            Assert.AreEqual(employeeAppointmentList.Count(), actual.Count());     //passes
        }
        public void Task_GetEmployeeAppointments_Return_ListOfEmployeeAppointment()
        {
            //Arrange

            IQueryable <EmployeeAppointment> employeeAppointmentList = new List <EmployeeAppointment>()
            {
                new EmployeeAppointment()
                {
                    AppointmentId = 1, Id = 1
                }, new EmployeeAppointment()
                {
                    AppointmentId = 2, Id = 2
                }
            }.AsQueryable();

            EmployeeAppointmentRepositoryMock.Setup(m => m.Get(null, null)).Returns(employeeAppointmentList).Verifiable();

            //Act
            var actual = EmployeeAppointmentsBusinessManager.Get();

            //Assert
            Assert.IsInstanceOfType(actual, typeof(IQueryable <EmployeeAppointment>));     //passes
        }