EA.Iws.Domain.ValuePerWeight.CheckIsValid C# (CSharp) Method

CheckIsValid() private method

private CheckIsValid ( ValuePerWeightUnits units, decimal amount ) : void
units ValuePerWeightUnits
amount decimal
return void
        private void CheckIsValid(ValuePerWeightUnits units, decimal amount)
        {
            if (!canHaveNegativeAmount && amount < 0)
            {
                throw new InvalidOperationException("The amount cannot be negative");
            }

            if (units == default(ValuePerWeightUnits))
            {
                throw new InvalidOperationException("Units cannot be the default value");
            }
        }
    }