public void FromVoltsPerMeter_WithInfinityValue_ThrowsArgumentException() { Assert.Throws <ArgumentException>(() => ElectricField.FromVoltsPerMeter(double.PositiveInfinity)); Assert.Throws <ArgumentException>(() => ElectricField.FromVoltsPerMeter(double.NegativeInfinity)); }
public void FromVoltsPerMeter_WithNanValue_ThrowsArgumentException() { Assert.Throws <ArgumentException>(() => ElectricField.FromVoltsPerMeter(double.NaN)); }
public void As() { var voltpermeter = ElectricField.FromVoltsPerMeter(1); AssertEx.EqualTolerance(VoltsPerMeterInOneVoltPerMeter, voltpermeter.As(ElectricFieldUnit.VoltPerMeter), VoltsPerMeterTolerance); }
public void VoltPerMeterToElectricFieldUnits() { ElectricField voltpermeter = ElectricField.FromVoltsPerMeter(1); AssertEx.EqualTolerance(VoltsPerMeterInOneVoltPerMeter, voltpermeter.VoltsPerMeter, VoltsPerMeterTolerance); }
public void EqualsReturnsFalseOnNull() { ElectricField voltpermeter = ElectricField.FromVoltsPerMeter(1); Assert.False(voltpermeter.Equals(null)); }
public void EqualsReturnsFalseOnTypeMismatch() { ElectricField voltpermeter = ElectricField.FromVoltsPerMeter(1); Assert.False(voltpermeter.Equals(new object())); }
public void CompareToThrowsOnNull() { ElectricField voltpermeter = ElectricField.FromVoltsPerMeter(1); Assert.Throws <ArgumentNullException>(() => voltpermeter.CompareTo(null)); }
public void CompareToThrowsOnTypeMismatch() { ElectricField voltpermeter = ElectricField.FromVoltsPerMeter(1); Assert.Throws <ArgumentException>(() => voltpermeter.CompareTo(new object())); }
public void ConversionRoundTrip() { ElectricField voltpermeter = ElectricField.FromVoltsPerMeter(1); AssertEx.EqualTolerance(1, ElectricField.FromVoltsPerMeter(voltpermeter.VoltsPerMeter).VoltsPerMeter, VoltsPerMeterTolerance); }