public void EqualsIsImplemented() { DynamicViscosity v = DynamicViscosity.FromNewtonSecondsPerMeterSquared(1); Assert.True(v.Equals(DynamicViscosity.FromNewtonSecondsPerMeterSquared(1), DynamicViscosity.FromNewtonSecondsPerMeterSquared(NewtonSecondsPerMeterSquaredTolerance))); Assert.False(v.Equals(DynamicViscosity.Zero, DynamicViscosity.FromNewtonSecondsPerMeterSquared(NewtonSecondsPerMeterSquaredTolerance))); }
public void ToUnit() { var newtonsecondpermetersquared = DynamicViscosity.FromNewtonSecondsPerMeterSquared(1); var centipoiseQuantity = newtonsecondpermetersquared.ToUnit(DynamicViscosityUnit.Centipoise); AssertEx.EqualTolerance(CentipoiseInOneNewtonSecondPerMeterSquared, (double)centipoiseQuantity.Value, CentipoiseTolerance); Assert.Equal(DynamicViscosityUnit.Centipoise, centipoiseQuantity.Unit); var micropascalsecondQuantity = newtonsecondpermetersquared.ToUnit(DynamicViscosityUnit.MicropascalSecond); AssertEx.EqualTolerance(MicropascalSecondsInOneNewtonSecondPerMeterSquared, (double)micropascalsecondQuantity.Value, MicropascalSecondsTolerance); Assert.Equal(DynamicViscosityUnit.MicropascalSecond, micropascalsecondQuantity.Unit); var millipascalsecondQuantity = newtonsecondpermetersquared.ToUnit(DynamicViscosityUnit.MillipascalSecond); AssertEx.EqualTolerance(MillipascalSecondsInOneNewtonSecondPerMeterSquared, (double)millipascalsecondQuantity.Value, MillipascalSecondsTolerance); Assert.Equal(DynamicViscosityUnit.MillipascalSecond, millipascalsecondQuantity.Unit); var newtonsecondpermetersquaredQuantity = newtonsecondpermetersquared.ToUnit(DynamicViscosityUnit.NewtonSecondPerMeterSquared); AssertEx.EqualTolerance(NewtonSecondsPerMeterSquaredInOneNewtonSecondPerMeterSquared, (double)newtonsecondpermetersquaredQuantity.Value, NewtonSecondsPerMeterSquaredTolerance); Assert.Equal(DynamicViscosityUnit.NewtonSecondPerMeterSquared, newtonsecondpermetersquaredQuantity.Unit); var pascalsecondQuantity = newtonsecondpermetersquared.ToUnit(DynamicViscosityUnit.PascalSecond); AssertEx.EqualTolerance(PascalSecondsInOneNewtonSecondPerMeterSquared, (double)pascalsecondQuantity.Value, PascalSecondsTolerance); Assert.Equal(DynamicViscosityUnit.PascalSecond, pascalsecondQuantity.Unit); var poiseQuantity = newtonsecondpermetersquared.ToUnit(DynamicViscosityUnit.Poise); AssertEx.EqualTolerance(PoiseInOneNewtonSecondPerMeterSquared, (double)poiseQuantity.Value, PoiseTolerance); Assert.Equal(DynamicViscosityUnit.Poise, poiseQuantity.Unit); }
public void EqualsIsImplemented() { DynamicViscosity v = DynamicViscosity.FromNewtonSecondsPerMeterSquared(1); Assert.IsTrue(v.Equals(DynamicViscosity.FromNewtonSecondsPerMeterSquared(1))); Assert.IsFalse(v.Equals(DynamicViscosity.Zero)); }
public void CompareToThrowsOnNull() { DynamicViscosity newtonsecondpermetersquared = DynamicViscosity.FromNewtonSecondsPerMeterSquared(1); // ReSharper disable once ReturnValueOfPureMethodIsNotUsed newtonsecondpermetersquared.CompareTo(null); }
public void EqualsRelativeToleranceIsImplemented() { var v = DynamicViscosity.FromNewtonSecondsPerMeterSquared(1); Assert.True(v.Equals(DynamicViscosity.FromNewtonSecondsPerMeterSquared(1), NewtonSecondsPerMeterSquaredTolerance, ComparisonType.Relative)); Assert.False(v.Equals(DynamicViscosity.Zero, NewtonSecondsPerMeterSquaredTolerance, ComparisonType.Relative)); }
public void ToUnit() { var newtonsecondpermetersquared = DynamicViscosity.FromNewtonSecondsPerMeterSquared(1); var centipoiseQuantity = newtonsecondpermetersquared.ToUnit(DynamicViscosityUnit.Centipoise); AssertEx.EqualTolerance(CentipoiseInOneNewtonSecondPerMeterSquared, (double)centipoiseQuantity.Value, CentipoiseTolerance); Assert.Equal(DynamicViscosityUnit.Centipoise, centipoiseQuantity.Unit); var micropascalsecondQuantity = newtonsecondpermetersquared.ToUnit(DynamicViscosityUnit.MicropascalSecond); AssertEx.EqualTolerance(MicropascalSecondsInOneNewtonSecondPerMeterSquared, (double)micropascalsecondQuantity.Value, MicropascalSecondsTolerance); Assert.Equal(DynamicViscosityUnit.MicropascalSecond, micropascalsecondQuantity.Unit); var millipascalsecondQuantity = newtonsecondpermetersquared.ToUnit(DynamicViscosityUnit.MillipascalSecond); AssertEx.EqualTolerance(MillipascalSecondsInOneNewtonSecondPerMeterSquared, (double)millipascalsecondQuantity.Value, MillipascalSecondsTolerance); Assert.Equal(DynamicViscosityUnit.MillipascalSecond, millipascalsecondQuantity.Unit); var newtonsecondpermetersquaredQuantity = newtonsecondpermetersquared.ToUnit(DynamicViscosityUnit.NewtonSecondPerMeterSquared); AssertEx.EqualTolerance(NewtonSecondsPerMeterSquaredInOneNewtonSecondPerMeterSquared, (double)newtonsecondpermetersquaredQuantity.Value, NewtonSecondsPerMeterSquaredTolerance); Assert.Equal(DynamicViscosityUnit.NewtonSecondPerMeterSquared, newtonsecondpermetersquaredQuantity.Unit); var pascalsecondQuantity = newtonsecondpermetersquared.ToUnit(DynamicViscosityUnit.PascalSecond); AssertEx.EqualTolerance(PascalSecondsInOneNewtonSecondPerMeterSquared, (double)pascalsecondQuantity.Value, PascalSecondsTolerance); Assert.Equal(DynamicViscosityUnit.PascalSecond, pascalsecondQuantity.Unit); var poiseQuantity = newtonsecondpermetersquared.ToUnit(DynamicViscosityUnit.Poise); AssertEx.EqualTolerance(PoiseInOneNewtonSecondPerMeterSquared, (double)poiseQuantity.Value, PoiseTolerance); Assert.Equal(DynamicViscosityUnit.Poise, poiseQuantity.Unit); var poundforcesecondpersquarefootQuantity = newtonsecondpermetersquared.ToUnit(DynamicViscosityUnit.PoundForceSecondPerSquareFoot); AssertEx.EqualTolerance(PoundsForceSecondPerSquareFootInOneNewtonSecondPerMeterSquared, (double)poundforcesecondpersquarefootQuantity.Value, PoundsForceSecondPerSquareFootTolerance); Assert.Equal(DynamicViscosityUnit.PoundForceSecondPerSquareFoot, poundforcesecondpersquarefootQuantity.Unit); var poundforcesecondpersquareinchQuantity = newtonsecondpermetersquared.ToUnit(DynamicViscosityUnit.PoundForceSecondPerSquareInch); AssertEx.EqualTolerance(PoundsForceSecondPerSquareInchInOneNewtonSecondPerMeterSquared, (double)poundforcesecondpersquareinchQuantity.Value, PoundsForceSecondPerSquareInchTolerance); Assert.Equal(DynamicViscosityUnit.PoundForceSecondPerSquareInch, poundforcesecondpersquareinchQuantity.Unit); var poundperfoothourQuantity = newtonsecondpermetersquared.ToUnit(DynamicViscosityUnit.PoundPerFootHour); AssertEx.EqualTolerance(PoundPerFootHoursInOneNewtonSecondPerMeterSquared, (double)poundperfoothourQuantity.Value, PoundPerFootHoursTolerance); Assert.Equal(DynamicViscosityUnit.PoundPerFootHour, poundperfoothourQuantity.Unit); var poundperfootsecondQuantity = newtonsecondpermetersquared.ToUnit(DynamicViscosityUnit.PoundPerFootSecond); AssertEx.EqualTolerance(PoundPerFootSecondsInOneNewtonSecondPerMeterSquared, (double)poundperfootsecondQuantity.Value, PoundPerFootSecondsTolerance); Assert.Equal(DynamicViscosityUnit.PoundPerFootSecond, poundperfootsecondQuantity.Unit); var reynQuantity = newtonsecondpermetersquared.ToUnit(DynamicViscosityUnit.Reyn); AssertEx.EqualTolerance(ReynsInOneNewtonSecondPerMeterSquared, (double)reynQuantity.Value, ReynsTolerance); Assert.Equal(DynamicViscosityUnit.Reyn, reynQuantity.Unit); }
public void Equals_SameType_IsImplemented() { var a = DynamicViscosity.FromNewtonSecondsPerMeterSquared(1); var b = DynamicViscosity.FromNewtonSecondsPerMeterSquared(2); Assert.True(a.Equals(a)); Assert.False(a.Equals(b)); }
public void FromNewtonSecondsPerMeterSquared_WithInfinityValue_CreateQuantityAndAffectInfinityValue() { var positiveInfinityQuantity = DynamicViscosity.FromNewtonSecondsPerMeterSquared(double.PositiveInfinity); var negativeInfinityQuantity = DynamicViscosity.FromNewtonSecondsPerMeterSquared(double.NegativeInfinity); Assert.True(double.IsPositiveInfinity(positiveInfinityQuantity.Value)); Assert.True(double.IsNegativeInfinity(negativeInfinityQuantity.Value)); }
public void CompareToIsImplemented() { DynamicViscosity newtonsecondpermetersquared = DynamicViscosity.FromNewtonSecondsPerMeterSquared(1); Assert.AreEqual(0, newtonsecondpermetersquared.CompareTo(newtonsecondpermetersquared)); Assert.Greater(newtonsecondpermetersquared.CompareTo(DynamicViscosity.Zero), 0); Assert.Less(DynamicViscosity.Zero.CompareTo(newtonsecondpermetersquared), 0); }
public void CompareToIsImplemented() { DynamicViscosity newtonsecondpermetersquared = DynamicViscosity.FromNewtonSecondsPerMeterSquared(1); Assert.Equal(0, newtonsecondpermetersquared.CompareTo(newtonsecondpermetersquared)); Assert.True(newtonsecondpermetersquared.CompareTo(DynamicViscosity.Zero) > 0); Assert.True(DynamicViscosity.Zero.CompareTo(newtonsecondpermetersquared) < 0); }
public void Equals_QuantityAsObject_IsImplemented() { object a = DynamicViscosity.FromNewtonSecondsPerMeterSquared(1); object b = DynamicViscosity.FromNewtonSecondsPerMeterSquared(2); Assert.True(a.Equals(a)); Assert.False(a.Equals(b)); Assert.False(a.Equals((object)null)); }
public void NewtonSecondPerMeterSquaredToDynamicViscosityUnits() { DynamicViscosity newtonsecondpermetersquared = DynamicViscosity.FromNewtonSecondsPerMeterSquared(1); Assert.AreEqual(CentipoiseInOneNewtonSecondPerMeterSquared, newtonsecondpermetersquared.Centipoise, CentipoiseTolerance); Assert.AreEqual(MillipascalSecondsInOneNewtonSecondPerMeterSquared, newtonsecondpermetersquared.MillipascalSeconds, MillipascalSecondsTolerance); Assert.AreEqual(NewtonSecondsPerMeterSquaredInOneNewtonSecondPerMeterSquared, newtonsecondpermetersquared.NewtonSecondsPerMeterSquared, NewtonSecondsPerMeterSquaredTolerance); Assert.AreEqual(PascalSecondsInOneNewtonSecondPerMeterSquared, newtonsecondpermetersquared.PascalSeconds, PascalSecondsTolerance); Assert.AreEqual(PoiseInOneNewtonSecondPerMeterSquared, newtonsecondpermetersquared.Poise, PoiseTolerance); }
public void As() { var newtonsecondpermetersquared = DynamicViscosity.FromNewtonSecondsPerMeterSquared(1); Assert.AreEqual(CentipoiseInOneNewtonSecondPerMeterSquared, newtonsecondpermetersquared.As(DynamicViscosityUnit.Centipoise), CentipoiseTolerance); Assert.AreEqual(MillipascalSecondsInOneNewtonSecondPerMeterSquared, newtonsecondpermetersquared.As(DynamicViscosityUnit.MillipascalSecond), MillipascalSecondsTolerance); Assert.AreEqual(NewtonSecondsPerMeterSquaredInOneNewtonSecondPerMeterSquared, newtonsecondpermetersquared.As(DynamicViscosityUnit.NewtonSecondPerMeterSquared), NewtonSecondsPerMeterSquaredTolerance); Assert.AreEqual(PascalSecondsInOneNewtonSecondPerMeterSquared, newtonsecondpermetersquared.As(DynamicViscosityUnit.PascalSecond), PascalSecondsTolerance); Assert.AreEqual(PoiseInOneNewtonSecondPerMeterSquared, newtonsecondpermetersquared.As(DynamicViscosityUnit.Poise), PoiseTolerance); }
public void ConversionRoundTrip() { DynamicViscosity newtonsecondpermetersquared = DynamicViscosity.FromNewtonSecondsPerMeterSquared(1); Assert.AreEqual(1, DynamicViscosity.FromCentipoise(newtonsecondpermetersquared.Centipoise).NewtonSecondsPerMeterSquared, CentipoiseTolerance); Assert.AreEqual(1, DynamicViscosity.FromMillipascalSeconds(newtonsecondpermetersquared.MillipascalSeconds).NewtonSecondsPerMeterSquared, MillipascalSecondsTolerance); Assert.AreEqual(1, DynamicViscosity.FromNewtonSecondsPerMeterSquared(newtonsecondpermetersquared.NewtonSecondsPerMeterSquared).NewtonSecondsPerMeterSquared, NewtonSecondsPerMeterSquaredTolerance); Assert.AreEqual(1, DynamicViscosity.FromPascalSeconds(newtonsecondpermetersquared.PascalSeconds).NewtonSecondsPerMeterSquared, PascalSecondsTolerance); Assert.AreEqual(1, DynamicViscosity.FromPoise(newtonsecondpermetersquared.Poise).NewtonSecondsPerMeterSquared, PoiseTolerance); }
public void To_UnitSystem_ThrowsArgumentExceptionIfNotSupported() { var newtonsecondpermetersquared = DynamicViscosity.FromNewtonSecondsPerMeterSquared(1); Assert.Throws <ArgumentException>(() => newtonsecondpermetersquared.ToUnit(UnitSystem.SI)); Assert.Throws <ArgumentException>(() => newtonsecondpermetersquared.ToUnit(UnitSystem.CGS)); Assert.Throws <ArgumentException>(() => newtonsecondpermetersquared.ToUnit(UnitSystem.BI)); Assert.Throws <ArgumentException>(() => newtonsecondpermetersquared.ToUnit(UnitSystem.EE)); Assert.Throws <ArgumentException>(() => newtonsecondpermetersquared.ToUnit(UnitSystem.USC)); Assert.Throws <ArgumentException>(() => newtonsecondpermetersquared.ToUnit(UnitSystem.FPS)); Assert.Throws <ArgumentException>(() => newtonsecondpermetersquared.ToUnit(UnitSystem.Astronomical)); }
public void ArithmeticOperators() { DynamicViscosity v = DynamicViscosity.FromNewtonSecondsPerMeterSquared(1); AssertEx.EqualTolerance(-1, -v.NewtonSecondsPerMeterSquared, NewtonSecondsPerMeterSquaredTolerance); AssertEx.EqualTolerance(2, (DynamicViscosity.FromNewtonSecondsPerMeterSquared(3) - v).NewtonSecondsPerMeterSquared, NewtonSecondsPerMeterSquaredTolerance); AssertEx.EqualTolerance(2, (v + v).NewtonSecondsPerMeterSquared, NewtonSecondsPerMeterSquaredTolerance); AssertEx.EqualTolerance(10, (v * 10).NewtonSecondsPerMeterSquared, NewtonSecondsPerMeterSquaredTolerance); AssertEx.EqualTolerance(10, (10 * v).NewtonSecondsPerMeterSquared, NewtonSecondsPerMeterSquaredTolerance); AssertEx.EqualTolerance(2, (DynamicViscosity.FromNewtonSecondsPerMeterSquared(10) / 5).NewtonSecondsPerMeterSquared, NewtonSecondsPerMeterSquaredTolerance); AssertEx.EqualTolerance(2, DynamicViscosity.FromNewtonSecondsPerMeterSquared(10) / DynamicViscosity.FromNewtonSecondsPerMeterSquared(5), NewtonSecondsPerMeterSquaredTolerance); }
public void EqualityOperators() { DynamicViscosity a = DynamicViscosity.FromNewtonSecondsPerMeterSquared(1); DynamicViscosity b = DynamicViscosity.FromNewtonSecondsPerMeterSquared(2); // ReSharper disable EqualExpressionComparison Assert.True(a == a); Assert.True(a != b); Assert.False(a == b); Assert.False(a != a); // ReSharper restore EqualExpressionComparison }
public void ConversionRoundTrip() { DynamicViscosity newtonsecondpermetersquared = DynamicViscosity.FromNewtonSecondsPerMeterSquared(1); AssertEx.EqualTolerance(1, DynamicViscosity.FromCentipoise(newtonsecondpermetersquared.Centipoise).NewtonSecondsPerMeterSquared, CentipoiseTolerance); AssertEx.EqualTolerance(1, DynamicViscosity.FromMicropascalSeconds(newtonsecondpermetersquared.MicropascalSeconds).NewtonSecondsPerMeterSquared, MicropascalSecondsTolerance); AssertEx.EqualTolerance(1, DynamicViscosity.FromMillipascalSeconds(newtonsecondpermetersquared.MillipascalSeconds).NewtonSecondsPerMeterSquared, MillipascalSecondsTolerance); AssertEx.EqualTolerance(1, DynamicViscosity.FromNewtonSecondsPerMeterSquared(newtonsecondpermetersquared.NewtonSecondsPerMeterSquared).NewtonSecondsPerMeterSquared, NewtonSecondsPerMeterSquaredTolerance); AssertEx.EqualTolerance(1, DynamicViscosity.FromPascalSeconds(newtonsecondpermetersquared.PascalSeconds).NewtonSecondsPerMeterSquared, PascalSecondsTolerance); AssertEx.EqualTolerance(1, DynamicViscosity.FromPoise(newtonsecondpermetersquared.Poise).NewtonSecondsPerMeterSquared, PoiseTolerance); AssertEx.EqualTolerance(1, DynamicViscosity.FromPoundsForceSecondPerSquareFoot(newtonsecondpermetersquared.PoundsForceSecondPerSquareFoot).NewtonSecondsPerMeterSquared, PoundsForceSecondPerSquareFootTolerance); AssertEx.EqualTolerance(1, DynamicViscosity.FromPoundsForceSecondPerSquareInch(newtonsecondpermetersquared.PoundsForceSecondPerSquareInch).NewtonSecondsPerMeterSquared, PoundsForceSecondPerSquareInchTolerance); AssertEx.EqualTolerance(1, DynamicViscosity.FromReyns(newtonsecondpermetersquared.Reyns).NewtonSecondsPerMeterSquared, ReynsTolerance); }
public void As() { var newtonsecondpermetersquared = DynamicViscosity.FromNewtonSecondsPerMeterSquared(1); AssertEx.EqualTolerance(CentipoiseInOneNewtonSecondPerMeterSquared, newtonsecondpermetersquared.As(DynamicViscosityUnit.Centipoise), CentipoiseTolerance); AssertEx.EqualTolerance(MicropascalSecondsInOneNewtonSecondPerMeterSquared, newtonsecondpermetersquared.As(DynamicViscosityUnit.MicropascalSecond), MicropascalSecondsTolerance); AssertEx.EqualTolerance(MillipascalSecondsInOneNewtonSecondPerMeterSquared, newtonsecondpermetersquared.As(DynamicViscosityUnit.MillipascalSecond), MillipascalSecondsTolerance); AssertEx.EqualTolerance(NewtonSecondsPerMeterSquaredInOneNewtonSecondPerMeterSquared, newtonsecondpermetersquared.As(DynamicViscosityUnit.NewtonSecondPerMeterSquared), NewtonSecondsPerMeterSquaredTolerance); AssertEx.EqualTolerance(PascalSecondsInOneNewtonSecondPerMeterSquared, newtonsecondpermetersquared.As(DynamicViscosityUnit.PascalSecond), PascalSecondsTolerance); AssertEx.EqualTolerance(PoiseInOneNewtonSecondPerMeterSquared, newtonsecondpermetersquared.As(DynamicViscosityUnit.Poise), PoiseTolerance); AssertEx.EqualTolerance(PoundsForceSecondPerSquareFootInOneNewtonSecondPerMeterSquared, newtonsecondpermetersquared.As(DynamicViscosityUnit.PoundForceSecondPerSquareFoot), PoundsForceSecondPerSquareFootTolerance); AssertEx.EqualTolerance(PoundsForceSecondPerSquareInchInOneNewtonSecondPerMeterSquared, newtonsecondpermetersquared.As(DynamicViscosityUnit.PoundForceSecondPerSquareInch), PoundsForceSecondPerSquareInchTolerance); AssertEx.EqualTolerance(ReynsInOneNewtonSecondPerMeterSquared, newtonsecondpermetersquared.As(DynamicViscosityUnit.Reyn), ReynsTolerance); }
public void NewtonSecondPerMeterSquaredToDynamicViscosityUnits() { DynamicViscosity newtonsecondpermetersquared = DynamicViscosity.FromNewtonSecondsPerMeterSquared(1); AssertEx.EqualTolerance(CentipoiseInOneNewtonSecondPerMeterSquared, newtonsecondpermetersquared.Centipoise, CentipoiseTolerance); AssertEx.EqualTolerance(MicropascalSecondsInOneNewtonSecondPerMeterSquared, newtonsecondpermetersquared.MicropascalSeconds, MicropascalSecondsTolerance); AssertEx.EqualTolerance(MillipascalSecondsInOneNewtonSecondPerMeterSquared, newtonsecondpermetersquared.MillipascalSeconds, MillipascalSecondsTolerance); AssertEx.EqualTolerance(NewtonSecondsPerMeterSquaredInOneNewtonSecondPerMeterSquared, newtonsecondpermetersquared.NewtonSecondsPerMeterSquared, NewtonSecondsPerMeterSquaredTolerance); AssertEx.EqualTolerance(PascalSecondsInOneNewtonSecondPerMeterSquared, newtonsecondpermetersquared.PascalSeconds, PascalSecondsTolerance); AssertEx.EqualTolerance(PoiseInOneNewtonSecondPerMeterSquared, newtonsecondpermetersquared.Poise, PoiseTolerance); AssertEx.EqualTolerance(PoundsForceSecondPerSquareFootInOneNewtonSecondPerMeterSquared, newtonsecondpermetersquared.PoundsForceSecondPerSquareFoot, PoundsForceSecondPerSquareFootTolerance); AssertEx.EqualTolerance(PoundsForceSecondPerSquareInchInOneNewtonSecondPerMeterSquared, newtonsecondpermetersquared.PoundsForceSecondPerSquareInch, PoundsForceSecondPerSquareInchTolerance); AssertEx.EqualTolerance(ReynsInOneNewtonSecondPerMeterSquared, newtonsecondpermetersquared.Reyns, ReynsTolerance); }
public void ComparisonOperators() { DynamicViscosity oneNewtonSecondPerMeterSquared = DynamicViscosity.FromNewtonSecondsPerMeterSquared(1); DynamicViscosity twoNewtonSecondsPerMeterSquared = DynamicViscosity.FromNewtonSecondsPerMeterSquared(2); Assert.True(oneNewtonSecondPerMeterSquared < twoNewtonSecondsPerMeterSquared); Assert.True(oneNewtonSecondPerMeterSquared <= twoNewtonSecondsPerMeterSquared); Assert.True(twoNewtonSecondsPerMeterSquared > oneNewtonSecondPerMeterSquared); Assert.True(twoNewtonSecondsPerMeterSquared >= oneNewtonSecondPerMeterSquared); Assert.False(oneNewtonSecondPerMeterSquared > twoNewtonSecondsPerMeterSquared); Assert.False(oneNewtonSecondPerMeterSquared >= twoNewtonSecondsPerMeterSquared); Assert.False(twoNewtonSecondsPerMeterSquared < oneNewtonSecondPerMeterSquared); Assert.False(twoNewtonSecondsPerMeterSquared <= oneNewtonSecondPerMeterSquared); }
public void EqualityOperators() { var a = DynamicViscosity.FromNewtonSecondsPerMeterSquared(1); var b = DynamicViscosity.FromNewtonSecondsPerMeterSquared(2); #pragma warning disable CS8073 // ReSharper disable EqualExpressionComparison Assert.True(a == a); Assert.False(a != a); Assert.True(a != b); Assert.False(a == b); Assert.False(a == null); Assert.False(null == a); // ReSharper restore EqualExpressionComparison #pragma warning restore CS8073 }
public void FromNewtonSecondsPerMeterSquared_WithInfinityValue_ThrowsArgumentException() { Assert.Throws <ArgumentException>(() => DynamicViscosity.FromNewtonSecondsPerMeterSquared(double.PositiveInfinity)); Assert.Throws <ArgumentException>(() => DynamicViscosity.FromNewtonSecondsPerMeterSquared(double.NegativeInfinity)); }
public void CompareToThrowsOnNull() { DynamicViscosity newtonsecondpermetersquared = DynamicViscosity.FromNewtonSecondsPerMeterSquared(1); Assert.Throws <ArgumentNullException>(() => newtonsecondpermetersquared.CompareTo(null)); }
public void CompareToThrowsOnTypeMismatch() { DynamicViscosity newtonsecondpermetersquared = DynamicViscosity.FromNewtonSecondsPerMeterSquared(1); Assert.Throws <ArgumentException>(() => newtonsecondpermetersquared.CompareTo(new object())); }
public void FromNewtonSecondsPerMeterSquared_WithNanValue_ThrowsArgumentException() { Assert.Throws <ArgumentException>(() => DynamicViscosity.FromNewtonSecondsPerMeterSquared(double.NaN)); }
/// <inheritdoc cref="DynamicViscosity.FromNewtonSecondsPerMeterSquared(double?)"/> public static DynamicViscosity?NewtonSecondsPerMeterSquared(this decimal?value) => DynamicViscosity.FromNewtonSecondsPerMeterSquared(value == null ? (double?)null : Convert.ToDouble(value.Value));
public void EqualsReturnsFalseOnTypeMismatch() { DynamicViscosity newtonsecondpermetersquared = DynamicViscosity.FromNewtonSecondsPerMeterSquared(1); Assert.False(newtonsecondpermetersquared.Equals(new object())); }
public void EqualsReturnsFalseOnNull() { DynamicViscosity newtonsecondpermetersquared = DynamicViscosity.FromNewtonSecondsPerMeterSquared(1); Assert.False(newtonsecondpermetersquared.Equals(null)); }
/// <inheritdoc cref="DynamicViscosity.FromNewtonSecondsPerMeterSquared(double)"/> public static DynamicViscosity NewtonSecondsPerMeterSquared(this decimal value) => DynamicViscosity.FromNewtonSecondsPerMeterSquared(Convert.ToDouble(value));