private void ValidateRanges(List <Department> departments, Department department)
        {
            if (!DepartmentValidations.IsValidWeightRanges(departments, department))
            {
                throw new DomainException("The value is confliting with the existing Weights.");
            }

            if (!DepartmentValidations.IsValidValueRanges(departments, department))
            {
                throw new DomainException("The value is confliting with the existing Minimum Parcel Values.");
            }
        }
        public void Add_department_overlapping_value_existent_must_returns_false(
            double newDepartmentMinValue,
            double newDepartmentMaxValue,
            double departmentMinValue,
            double departmentMaxValue)
        {
            //Arrange
            var _departments = new List <Department> {
                new Department(0, 0, departmentMinValue, departmentMaxValue, _validName)
            };
            var newDepartment = new Department(0, 0, newDepartmentMinValue, newDepartmentMaxValue, "New Department");

            //Act
            _departments.Add(newDepartment);
            var result = DepartmentValidations.IsValidValueRanges(_departments, newDepartment);

            //Assert
            Assert.False(result);
        }
        public void Insert_department_without_overlap_previous_values_must_returns_true(
            double newDepartmentMinValue,
            double newDepartmentMaxValue,
            double departmentMinValue,
            double departmentMaxValue)
        {
            //Arrange
            var _departments = new List <Department> {
                new Department(0, 0, departmentMinValue, departmentMaxValue, _validName)
            };
            var newDepartment = new Department(0, 0, newDepartmentMinValue, newDepartmentMaxValue, "New Department");

            //Act
            _departments.Add(newDepartment);
            var result = DepartmentValidations.IsValidValueRanges(_departments, newDepartment);

            //Assert
            Assert.True(result);
        }