public void IsPhoneContainedInOtherDepartments_ReturnsTrue()
        {
            var options = new DbContextOptionsBuilder <ApplicationDbContext>().UseInMemoryDatabase(Guid.NewGuid().ToString()).Options;

            using (var dbContext = new ApplicationDbContext(options))
            {
                Department department = new Department()
                {
                    Name = "test", Email = "*****@*****.**"
                };
                Department department2 = new Department()
                {
                    Name = "test", Email = "*****@*****.**"
                };
                dbContext.Departments.Add(department);
                dbContext.Departments.Add(department2);

                DepartmentPhone departmentPhone = new DepartmentPhone()
                {
                    DepartmentId = 1, PhoneId = 1
                };
                DepartmentPhone departmentPhone2 = new DepartmentPhone()
                {
                    DepartmentId = 2, PhoneId = 1
                };
                dbContext.DepartmentPhones.Add(departmentPhone);
                dbContext.DepartmentPhones.Add(departmentPhone2);

                Phone phone = new Phone()
                {
                    PhoneNumber = "0897248721"
                };
                phone.Departments.Add(departmentPhone);
                phone.Departments.Add(departmentPhone2);

                var phonesService = new PhonesService(dbContext);

                dbContext.Phones.Add(phone);
                dbContext.SaveChanges();

                var result = phonesService.IsPhoneContainedInOtherDepartments(phone.PhoneNumber);

                Assert.True(result);
            }
        }
        public void IsPhoneContainedInOtherDepartments_ReturnsFalse()
        {
            var options = new DbContextOptionsBuilder <ApplicationDbContext>().UseInMemoryDatabase(Guid.NewGuid().ToString()).Options;

            using (var dbContext = new ApplicationDbContext(options))
            {
                Phone phone = new Phone()
                {
                    PhoneNumber = "0897248721",
                };
                var phonesService = new PhonesService(dbContext);

                dbContext.Phones.Add(phone);
                dbContext.SaveChanges();

                var result = phonesService.IsPhoneContainedInOtherDepartments(phone.PhoneNumber);

                Assert.False(result);
            }
        }