Skip to content

Adding ArgumentException to quantity if constructed with Undefned val… #499

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Common/GeneratedCode/Quantities/Acceleration.Common.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static Acceleration()
/// <summary>
/// Creates the quantity with the given numeric value and unit.
/// </summary>
/// <param name="numericValue">Numeric value.</param>
/// <param name="numericValue">The numeric value to contruct this quantity with.</param>
/// <param name="unit">The unit representation to contruct this quantity with.</param>
/// <remarks>Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component.</remarks>
#if WINDOWS_UWP
Expand All @@ -95,6 +95,9 @@ static Acceleration()
#endif
Acceleration(double numericValue, AccelerationUnit unit)
{
if(unit == AccelerationUnit.Undefined)
throw new ArgumentException("The quantity can not be created with an undefined unit.", nameof(unit));

_value = numericValue;
_unit = unit;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static AmountOfSubstance()
/// <summary>
/// Creates the quantity with the given numeric value and unit.
/// </summary>
/// <param name="numericValue">Numeric value.</param>
/// <param name="numericValue">The numeric value to contruct this quantity with.</param>
/// <param name="unit">The unit representation to contruct this quantity with.</param>
/// <remarks>Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component.</remarks>
#if WINDOWS_UWP
Expand All @@ -95,6 +95,9 @@ static AmountOfSubstance()
#endif
AmountOfSubstance(double numericValue, AmountOfSubstanceUnit unit)
{
if(unit == AmountOfSubstanceUnit.Undefined)
throw new ArgumentException("The quantity can not be created with an undefined unit.", nameof(unit));

_value = numericValue;
_unit = unit;
}
Expand Down
5 changes: 4 additions & 1 deletion Common/GeneratedCode/Quantities/AmplitudeRatio.Common.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ static AmplitudeRatio()
/// <summary>
/// Creates the quantity with the given numeric value and unit.
/// </summary>
/// <param name="numericValue">Numeric value.</param>
/// <param name="numericValue">The numeric value to contruct this quantity with.</param>
/// <param name="unit">The unit representation to contruct this quantity with.</param>
/// <remarks>Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component.</remarks>
#if WINDOWS_UWP
Expand All @@ -94,6 +94,9 @@ static AmplitudeRatio()
#endif
AmplitudeRatio(double numericValue, AmplitudeRatioUnit unit)
{
if(unit == AmplitudeRatioUnit.Undefined)
throw new ArgumentException("The quantity can not be created with an undefined unit.", nameof(unit));

_value = numericValue;
_unit = unit;
}
Expand Down
5 changes: 4 additions & 1 deletion Common/GeneratedCode/Quantities/Angle.Common.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ static Angle()
/// <summary>
/// Creates the quantity with the given numeric value and unit.
/// </summary>
/// <param name="numericValue">Numeric value.</param>
/// <param name="numericValue">The numeric value to contruct this quantity with.</param>
/// <param name="unit">The unit representation to contruct this quantity with.</param>
/// <remarks>Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component.</remarks>
#if WINDOWS_UWP
Expand All @@ -94,6 +94,9 @@ static Angle()
#endif
Angle(double numericValue, AngleUnit unit)
{
if(unit == AngleUnit.Undefined)
throw new ArgumentException("The quantity can not be created with an undefined unit.", nameof(unit));

_value = numericValue;
_unit = unit;
}
Expand Down
5 changes: 4 additions & 1 deletion Common/GeneratedCode/Quantities/ApparentEnergy.Common.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static ApparentEnergy()
/// <summary>
/// Creates the quantity with the given numeric value and unit.
/// </summary>
/// <param name="numericValue">Numeric value.</param>
/// <param name="numericValue">The numeric value to contruct this quantity with.</param>
/// <param name="unit">The unit representation to contruct this quantity with.</param>
/// <remarks>Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component.</remarks>
#if WINDOWS_UWP
Expand All @@ -95,6 +95,9 @@ static ApparentEnergy()
#endif
ApparentEnergy(double numericValue, ApparentEnergyUnit unit)
{
if(unit == ApparentEnergyUnit.Undefined)
throw new ArgumentException("The quantity can not be created with an undefined unit.", nameof(unit));

_value = numericValue;
_unit = unit;
}
Expand Down
5 changes: 4 additions & 1 deletion Common/GeneratedCode/Quantities/ApparentPower.Common.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static ApparentPower()
/// <summary>
/// Creates the quantity with the given numeric value and unit.
/// </summary>
/// <param name="numericValue">Numeric value.</param>
/// <param name="numericValue">The numeric value to contruct this quantity with.</param>
/// <param name="unit">The unit representation to contruct this quantity with.</param>
/// <remarks>Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component.</remarks>
#if WINDOWS_UWP
Expand All @@ -95,6 +95,9 @@ static ApparentPower()
#endif
ApparentPower(double numericValue, ApparentPowerUnit unit)
{
if(unit == ApparentPowerUnit.Undefined)
throw new ArgumentException("The quantity can not be created with an undefined unit.", nameof(unit));

_value = numericValue;
_unit = unit;
}
Expand Down
5 changes: 4 additions & 1 deletion Common/GeneratedCode/Quantities/Area.Common.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static Area()
/// <summary>
/// Creates the quantity with the given numeric value and unit.
/// </summary>
/// <param name="numericValue">Numeric value.</param>
/// <param name="numericValue">The numeric value to contruct this quantity with.</param>
/// <param name="unit">The unit representation to contruct this quantity with.</param>
/// <remarks>Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component.</remarks>
#if WINDOWS_UWP
Expand All @@ -95,6 +95,9 @@ static Area()
#endif
Area(double numericValue, AreaUnit unit)
{
if(unit == AreaUnit.Undefined)
throw new ArgumentException("The quantity can not be created with an undefined unit.", nameof(unit));

_value = numericValue;
_unit = unit;
}
Expand Down
5 changes: 4 additions & 1 deletion Common/GeneratedCode/Quantities/AreaDensity.Common.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static AreaDensity()
/// <summary>
/// Creates the quantity with the given numeric value and unit.
/// </summary>
/// <param name="numericValue">Numeric value.</param>
/// <param name="numericValue">The numeric value to contruct this quantity with.</param>
/// <param name="unit">The unit representation to contruct this quantity with.</param>
/// <remarks>Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component.</remarks>
#if WINDOWS_UWP
Expand All @@ -95,6 +95,9 @@ static AreaDensity()
#endif
AreaDensity(double numericValue, AreaDensityUnit unit)
{
if(unit == AreaDensityUnit.Undefined)
throw new ArgumentException("The quantity can not be created with an undefined unit.", nameof(unit));

_value = numericValue;
_unit = unit;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static AreaMomentOfInertia()
/// <summary>
/// Creates the quantity with the given numeric value and unit.
/// </summary>
/// <param name="numericValue">Numeric value.</param>
/// <param name="numericValue">The numeric value to contruct this quantity with.</param>
/// <param name="unit">The unit representation to contruct this quantity with.</param>
/// <remarks>Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component.</remarks>
#if WINDOWS_UWP
Expand All @@ -95,6 +95,9 @@ static AreaMomentOfInertia()
#endif
AreaMomentOfInertia(double numericValue, AreaMomentOfInertiaUnit unit)
{
if(unit == AreaMomentOfInertiaUnit.Undefined)
throw new ArgumentException("The quantity can not be created with an undefined unit.", nameof(unit));

_value = numericValue;
_unit = unit;
}
Expand Down
5 changes: 4 additions & 1 deletion Common/GeneratedCode/Quantities/BitRate.Common.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ static BitRate()
/// <summary>
/// Creates the quantity with the given numeric value and unit.
/// </summary>
/// <param name="numericValue">Numeric value.</param>
/// <param name="numericValue">The numeric value to contruct this quantity with.</param>
/// <param name="unit">The unit representation to contruct this quantity with.</param>
/// <remarks>Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component.</remarks>
#if WINDOWS_UWP
Expand All @@ -94,6 +94,9 @@ static BitRate()
#endif
BitRate(decimal numericValue, BitRateUnit unit)
{
if(unit == BitRateUnit.Undefined)
throw new ArgumentException("The quantity can not be created with an undefined unit.", nameof(unit));

_value = numericValue;
_unit = unit;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static BrakeSpecificFuelConsumption()
/// <summary>
/// Creates the quantity with the given numeric value and unit.
/// </summary>
/// <param name="numericValue">Numeric value.</param>
/// <param name="numericValue">The numeric value to contruct this quantity with.</param>
/// <param name="unit">The unit representation to contruct this quantity with.</param>
/// <remarks>Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component.</remarks>
#if WINDOWS_UWP
Expand All @@ -95,6 +95,9 @@ static BrakeSpecificFuelConsumption()
#endif
BrakeSpecificFuelConsumption(double numericValue, BrakeSpecificFuelConsumptionUnit unit)
{
if(unit == BrakeSpecificFuelConsumptionUnit.Undefined)
throw new ArgumentException("The quantity can not be created with an undefined unit.", nameof(unit));

_value = numericValue;
_unit = unit;
}
Expand Down
5 changes: 4 additions & 1 deletion Common/GeneratedCode/Quantities/Capacitance.Common.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static Capacitance()
/// <summary>
/// Creates the quantity with the given numeric value and unit.
/// </summary>
/// <param name="numericValue">Numeric value.</param>
/// <param name="numericValue">The numeric value to contruct this quantity with.</param>
/// <param name="unit">The unit representation to contruct this quantity with.</param>
/// <remarks>Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component.</remarks>
#if WINDOWS_UWP
Expand All @@ -95,6 +95,9 @@ static Capacitance()
#endif
Capacitance(double numericValue, CapacitanceUnit unit)
{
if(unit == CapacitanceUnit.Undefined)
throw new ArgumentException("The quantity can not be created with an undefined unit.", nameof(unit));

_value = numericValue;
_unit = unit;
}
Expand Down
5 changes: 4 additions & 1 deletion Common/GeneratedCode/Quantities/Density.Common.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static Density()
/// <summary>
/// Creates the quantity with the given numeric value and unit.
/// </summary>
/// <param name="numericValue">Numeric value.</param>
/// <param name="numericValue">The numeric value to contruct this quantity with.</param>
/// <param name="unit">The unit representation to contruct this quantity with.</param>
/// <remarks>Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component.</remarks>
#if WINDOWS_UWP
Expand All @@ -95,6 +95,9 @@ static Density()
#endif
Density(double numericValue, DensityUnit unit)
{
if(unit == DensityUnit.Undefined)
throw new ArgumentException("The quantity can not be created with an undefined unit.", nameof(unit));

_value = numericValue;
_unit = unit;
}
Expand Down
5 changes: 4 additions & 1 deletion Common/GeneratedCode/Quantities/Duration.Common.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static Duration()
/// <summary>
/// Creates the quantity with the given numeric value and unit.
/// </summary>
/// <param name="numericValue">Numeric value.</param>
/// <param name="numericValue">The numeric value to contruct this quantity with.</param>
/// <param name="unit">The unit representation to contruct this quantity with.</param>
/// <remarks>Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component.</remarks>
#if WINDOWS_UWP
Expand All @@ -95,6 +95,9 @@ static Duration()
#endif
Duration(double numericValue, DurationUnit unit)
{
if(unit == DurationUnit.Undefined)
throw new ArgumentException("The quantity can not be created with an undefined unit.", nameof(unit));

_value = numericValue;
_unit = unit;
}
Expand Down
5 changes: 4 additions & 1 deletion Common/GeneratedCode/Quantities/DynamicViscosity.Common.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static DynamicViscosity()
/// <summary>
/// Creates the quantity with the given numeric value and unit.
/// </summary>
/// <param name="numericValue">Numeric value.</param>
/// <param name="numericValue">The numeric value to contruct this quantity with.</param>
/// <param name="unit">The unit representation to contruct this quantity with.</param>
/// <remarks>Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component.</remarks>
#if WINDOWS_UWP
Expand All @@ -95,6 +95,9 @@ static DynamicViscosity()
#endif
DynamicViscosity(double numericValue, DynamicViscosityUnit unit)
{
if(unit == DynamicViscosityUnit.Undefined)
throw new ArgumentException("The quantity can not be created with an undefined unit.", nameof(unit));

_value = numericValue;
_unit = unit;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static ElectricAdmittance()
/// <summary>
/// Creates the quantity with the given numeric value and unit.
/// </summary>
/// <param name="numericValue">Numeric value.</param>
/// <param name="numericValue">The numeric value to contruct this quantity with.</param>
/// <param name="unit">The unit representation to contruct this quantity with.</param>
/// <remarks>Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component.</remarks>
#if WINDOWS_UWP
Expand All @@ -95,6 +95,9 @@ static ElectricAdmittance()
#endif
ElectricAdmittance(double numericValue, ElectricAdmittanceUnit unit)
{
if(unit == ElectricAdmittanceUnit.Undefined)
throw new ArgumentException("The quantity can not be created with an undefined unit.", nameof(unit));

_value = numericValue;
_unit = unit;
}
Expand Down
5 changes: 4 additions & 1 deletion Common/GeneratedCode/Quantities/ElectricCharge.Common.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static ElectricCharge()
/// <summary>
/// Creates the quantity with the given numeric value and unit.
/// </summary>
/// <param name="numericValue">Numeric value.</param>
/// <param name="numericValue">The numeric value to contruct this quantity with.</param>
/// <param name="unit">The unit representation to contruct this quantity with.</param>
/// <remarks>Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component.</remarks>
#if WINDOWS_UWP
Expand All @@ -95,6 +95,9 @@ static ElectricCharge()
#endif
ElectricCharge(double numericValue, ElectricChargeUnit unit)
{
if(unit == ElectricChargeUnit.Undefined)
throw new ArgumentException("The quantity can not be created with an undefined unit.", nameof(unit));

_value = numericValue;
_unit = unit;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static ElectricChargeDensity()
/// <summary>
/// Creates the quantity with the given numeric value and unit.
/// </summary>
/// <param name="numericValue">Numeric value.</param>
/// <param name="numericValue">The numeric value to contruct this quantity with.</param>
/// <param name="unit">The unit representation to contruct this quantity with.</param>
/// <remarks>Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component.</remarks>
#if WINDOWS_UWP
Expand All @@ -95,6 +95,9 @@ static ElectricChargeDensity()
#endif
ElectricChargeDensity(double numericValue, ElectricChargeDensityUnit unit)
{
if(unit == ElectricChargeDensityUnit.Undefined)
throw new ArgumentException("The quantity can not be created with an undefined unit.", nameof(unit));

_value = numericValue;
_unit = unit;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static ElectricConductance()
/// <summary>
/// Creates the quantity with the given numeric value and unit.
/// </summary>
/// <param name="numericValue">Numeric value.</param>
/// <param name="numericValue">The numeric value to contruct this quantity with.</param>
/// <param name="unit">The unit representation to contruct this quantity with.</param>
/// <remarks>Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component.</remarks>
#if WINDOWS_UWP
Expand All @@ -95,6 +95,9 @@ static ElectricConductance()
#endif
ElectricConductance(double numericValue, ElectricConductanceUnit unit)
{
if(unit == ElectricConductanceUnit.Undefined)
throw new ArgumentException("The quantity can not be created with an undefined unit.", nameof(unit));

_value = numericValue;
_unit = unit;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static ElectricConductivity()
/// <summary>
/// Creates the quantity with the given numeric value and unit.
/// </summary>
/// <param name="numericValue">Numeric value.</param>
/// <param name="numericValue">The numeric value to contruct this quantity with.</param>
/// <param name="unit">The unit representation to contruct this quantity with.</param>
/// <remarks>Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component.</remarks>
#if WINDOWS_UWP
Expand All @@ -95,6 +95,9 @@ static ElectricConductivity()
#endif
ElectricConductivity(double numericValue, ElectricConductivityUnit unit)
{
if(unit == ElectricConductivityUnit.Undefined)
throw new ArgumentException("The quantity can not be created with an undefined unit.", nameof(unit));

_value = numericValue;
_unit = unit;
}
Expand Down
5 changes: 4 additions & 1 deletion Common/GeneratedCode/Quantities/ElectricCurrent.Common.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static ElectricCurrent()
/// <summary>
/// Creates the quantity with the given numeric value and unit.
/// </summary>
/// <param name="numericValue">Numeric value.</param>
/// <param name="numericValue">The numeric value to contruct this quantity with.</param>
/// <param name="unit">The unit representation to contruct this quantity with.</param>
/// <remarks>Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component.</remarks>
#if WINDOWS_UWP
Expand All @@ -95,6 +95,9 @@ static ElectricCurrent()
#endif
ElectricCurrent(double numericValue, ElectricCurrentUnit unit)
{
if(unit == ElectricCurrentUnit.Undefined)
throw new ArgumentException("The quantity can not be created with an undefined unit.", nameof(unit));

_value = numericValue;
_unit = unit;
}
Expand Down
Loading