public void Add_Range()
        {
            Department_ENTITY_Repository repository = new Department_ENTITY_Repository();

            var newDepartments = new List <Department> {
                new Department {
                    Name = "Added item 1"
                },
                new Department {
                    Name = "Added item 2"
                },
                new Department {
                    Name = "Added item 3"
                },
                new Department {
                    Name = "Added item 4"
                }
            };

            using (var tempRepository = new Department_ENTITY_Repository())
            {
                tempRepository.Add(newDepartments);
                tempRepository.SaveChanges();
            }

            var newIds = newDepartments.Select(s => s.Id).ToArray();

            var result = repository.GetAll(filter: (x => newIds.Contains(x.Id))).ToList();

            Assert.IsNotNull(result);
            Assert.IsTrue(result.Count > 0);
            Assert.IsNull(result.First().PersonList);
        }
        public void Department_GetAll_Test()
        {
            Department_ENTITY_Repository repository = new Department_ENTITY_Repository();

            var result = repository.GetAll(navigationProperties: (x => x.PersonList)).ToList();

            Assert.IsNotNull(result);
            Assert.IsTrue(result.Count > 0);
            Assert.IsNotNull(result.First().PersonList);
            Assert.IsTrue(result.First().PersonList.Count > 0);
        }
        public void ConvertToView_Test()
        {
            Department_ENTITY_Repository repository = new Department_ENTITY_Repository();

            var result = repository.GetAll(navigationProperties: (x => x.PersonList)).ConvertToPersons_By_DepartmentView().ToList();

            Assert.IsNotNull(result);
            Assert.IsTrue(result.Count() > 0);
            Assert.IsInstanceOfType(result, typeof(IEnumerable <Persons_By_Department_View>));
            Assert.IsNotNull(result.First().PersonList);
            Assert.IsTrue(result.First().PersonList.Count() > 0);
        }
        public void Add_Test()
        {
            Department_ENTITY_Repository repository = new Department_ENTITY_Repository();

            var newDepartment = new Department {
                Id = 300, Name = "Added item"
            };

            using (var tempRepository = new Department_ENTITY_Repository())
            {
                tempRepository.Add(newDepartment);
                tempRepository.SaveChanges();
            }

            var result = repository.GetById(newDepartment.Id);

            Assert.IsNotNull(result);
            Assert.IsNull(result.PersonList);
        }