public void RømerAddNullTest() { double temp1 = 20; var rømer = new Rømer(temp1); Assert.AreEqual(rømer.Value, (rømer + null).Value); }
public void InRangeEmptyConstructorTest() { var rømer = new Rømer { Value = 500 }; Assert.AreEqual(500, rømer.Value, double.Epsilon); }
public void RømerSubtractionRømerFromFromTest() { double temp1 = 20; double temp2 = 30; var rømer = new Rømer(temp1); var rømer2 = new Rømer(temp2); Assert.AreEqual(rømer.Value - rømer2.Value, new Rømer(temp1 - temp2).Value); }
public void RømerSubtractionRømerFromRømerTest() { double temp1 = 20; double temp2 = 30; var rømer = new Rømer(temp1); var rømer2 = new Rømer(temp2); Assert.AreEqual(expected: new Rømer(temp1 - temp2), rømer - rømer2); }
public void RømerAddRømerFromValuesTest() { double temp1 = 20; double temp2 = 30; var rømer = new Rømer(temp1); var rømer2 = new Rømer(temp2); Assert.AreEqual(rømer.Value + rømer2.Value, new Rømer(temp1 + temp2).Value); }
public void RømerAddRømerFromRømerTest() { double temp1 = 20; double temp2 = 30; var rømer = new Rømer(temp1); var rømer2 = new Rømer(temp2); Assert.AreEqual(expected: new Rømer(temp1 + temp2), rømer + rømer2); }
public void ValidIConversionToRéaumurPassedTest() { var celsius = new Celsius(Constants.AbsoluteZeroInCelsius); var kelvin = new Kelvin(Constants.AbsoluteZeroInKelvin); var fahrenheit = new Fahrenheit(Constants.AbsoluteZeroInFahrenheit); var rankine = new Rankine(Constants.AbsoluteZeroInRankine); var delisle = new Delisle(Constants.AbsoluteZeroInDelisle); var newton = new Newton(Constants.AbsoluteZeroInNewton); var réaumur = new Réaumur(Constants.AbsoluteZeroInRéaumur); var rømer = new Rømer(Constants.AbsoluteZeroInRømer); Assert.AreEqual(Constants.AbsoluteZeroInRéaumur, Réaumur.ToRéaumur(kelvin).Value); Assert.AreEqual(Constants.AbsoluteZeroInRéaumur, Réaumur.ToRéaumur(celsius).Value); Assert.AreEqual(Constants.AbsoluteZeroInRéaumur, Réaumur.ToRéaumur(fahrenheit).Value); Assert.AreEqual(Constants.AbsoluteZeroInRéaumur, Réaumur.ToRéaumur(rankine).Value); Assert.AreEqual(Constants.AbsoluteZeroInRéaumur, Réaumur.ToRéaumur(delisle).Value); Assert.AreEqual(Constants.AbsoluteZeroInRéaumur, Réaumur.ToRéaumur(newton).Value); Assert.AreEqual(Constants.AbsoluteZeroInRéaumur, Réaumur.ToRéaumur(réaumur).Value); Assert.AreEqual(Constants.AbsoluteZeroInRéaumur, Réaumur.ToRéaumur(rømer).Value); }
public void OutOfRangeDoubleConstructorTest() { var rømer = new Rømer(-500); }
public void StaticFromDoubleToRéaumurAbsoluteZeroTest() => Assert.AreEqual(expected: Constants.AbsoluteZeroInRéaumur, Rømer.ToRéaumur(Constants.AbsoluteZeroInRømer).Value, 1e-13);
public void StaticFromDoubleToRéaumurBoilingPointTest() => Assert.AreEqual(expected: Constants.BoilingPointH2OInRéaumur, Rømer.ToRéaumur(Constants.BoilingPointH2OInRømer).Value);
public void StaticFromDoubleToCelsiusAbsoluteZeroTest() => Assert.AreEqual(expected: Constants.AbsoluteZeroInCelsius, Rømer.ToCelsius(Constants.AbsoluteZeroInRømer).Value);
public void StaticFromDoubleToNewtonBoilingPointTest() => Assert.AreEqual(expected: Constants.BoilingPointH2OInNewton, Rømer.ToNewton(Constants.BoilingPointH2OInRømer).Value);
public void NullAsUnitPassedToConstructorTest() { var rømer = new Rømer((IConversionToRømer)null); Assert.AreEqual(Constants.AbsoluteZeroInRømer, rømer.Value); }
public void NoValueStringConstructorTest() { var rømer = new Rømer(" K"); }
public void StaticFromDoubleToKelvinAbsoluteZeroTest() => Assert.AreEqual(expected: Constants.AbsoluteZeroInKelvin, Rømer.ToKelvin(Constants.AbsoluteZeroInRømer).Value);
public void AbsoluteZeroEmptyConstructorTest() { var rømer = new Rømer(); Assert.AreEqual(Constants.AbsoluteZeroInRømer, rømer.Value, double.Epsilon); }
public void StaticFromDoubleToFahrenheitBoilingPointTest() => Assert.AreEqual(expected: Constants.BoilingPointH2OInFahrenheit, Rømer.ToFahrenheit(Constants.BoilingPointH2OInRømer).Value, 1e-13);
public void StaticFromDoubleToRankineAbsoluteZeroTest() => Assert.AreEqual(expected: Constants.AbsoluteZeroInRankine, Rømer.ToRankine(Constants.AbsoluteZeroInRømer).Value);
public void StaticFromDoubleToFahrenheitAbsoluteZeroTest() => Assert.AreEqual(expected: Constants.AbsoluteZeroInFahrenheit, Rømer.ToFahrenheit(Constants.AbsoluteZeroInRømer).Value);
public void OutOfRangeEmptyConstructorTest() { var rømer = new Rømer { Value = -500 }; }
public void StaticFromDoubleToCelsiusBoilingPointTest() => Assert.AreEqual(expected: Constants.BoilingPointH2OInCelsius, Rømer.ToCelsius(Constants.BoilingPointH2OInRømer).Value);
public void DemoTest() { // Unit creation var rømer = new Rømer(Constants.MeltingPointH2OInRømer); Assert.AreEqual(Constants.MeltingPointH2OInRømer, rømer.Value); rømer = new Rømer("50.8 °Rø"); Assert.AreEqual(new Rømer(50.8), rømer); rømer = new Rømer("0 K"); Assert.AreEqual(new Kelvin(Constants.AbsoluteZeroInKelvin), rømer); var fahrenheit = new Fahrenheit(Constants.MeltingPointH2OInFahrenheit); var rømer2 = new Rømer(fahrenheit); Assert.AreEqual(fahrenheit, rømer2); // Arithmetic var rømer3 = rømer + rømer2; Assert.AreEqual(Constants.AbsoluteZeroInRømer + Constants.MeltingPointH2OInRømer, rømer3.Value); var rømer4 = rømer + fahrenheit; Assert.AreEqual(Constants.AbsoluteZeroInRømer + Constants.MeltingPointH2OInRømer, rømer4.Value); rømer3 = rømer2 - rømer; Assert.AreEqual(-Constants.AbsoluteZeroInRømer + Constants.MeltingPointH2OInRømer, rømer3.Value); rømer4 = rømer2 - fahrenheit; Assert.AreEqual(0.0, rømer4.Value); rømer3.Value = 20; rømer4.Value = 30; rømer3 += rømer4; Assert.AreEqual(50, rømer3.Value); rømer3 -= rømer4; Assert.AreEqual(20, rømer3.Value); // OOP Conversion rømer = new Rømer(fahrenheit.ToRømer()); Assert.AreEqual(rømer, fahrenheit); rømer = Rømer.ToRømer(fahrenheit); Assert.AreEqual(fahrenheit, rømer); double someTemperatureInRømer = Converter.Ran2Røm(Constants.BoilingPointH2OInRankine); double newValueInKelvin = Rømer.ToKelvin(someTemperatureInRømer).Value; Assert.AreEqual(someTemperatureInRømer, Converter.Kel2Røm(newValueInKelvin), OperationOverDoublePrecision.HighPrecision); // Comparison rømer.Value = 20; rømer2.Value = 20; Assert.AreEqual(rømer, rømer2); rømer = new Rømer(Constants.AbsoluteZeroInRømer); fahrenheit = new Fahrenheit(Constants.AbsoluteZeroInFahrenheit); Assert.AreEqual(rømer, fahrenheit); }
public void StaticFromDoubleToDelisleAbsoluteZeroTest() => Assert.AreEqual(expected: Constants.AbsoluteZeroInDelisle, Rømer.ToDelisle(Constants.AbsoluteZeroInRømer).Value, 1e-12);
public void NullAsStringPassedToConstructorTest() { var rømer = new Rømer((string)null); Assert.AreEqual(Constants.AbsoluteZeroInRømer, rømer.Value); }
public void StaticFromDoubleToDelisleBoilingPointTest() => Assert.AreEqual(expected: Constants.BoilingPointH2OInDelisle, Rømer.ToDelisle(Constants.BoilingPointH2OInRømer).Value);
public void OutOfRangeStringConstructorTest() { var rømer = new Rømer("-500"); }
public void StaticFromDoubleToNewtonAbsoluteZeroTest() => Assert.AreEqual(expected: Constants.AbsoluteZeroInNewton, Rømer.ToNewton(Constants.AbsoluteZeroInRømer).Value, 1e-13);
public void StaticFromDoubleToRankineMeltingPointTest() => Assert.AreEqual(expected: Constants.MeltingPointH2OInRankine, Rømer.ToRankine(Constants.MeltingPointH2OInRømer).Value, 1e-13);
public void StaticFromDoubleToKelvinMeltingPointTest() => Assert.AreEqual(expected: Constants.MeltingPointH2OInKelvin, Rømer.ToKelvin(Constants.MeltingPointH2OInRømer).Value);