我的代码是
public void Compare_CoolProp_with_CoreMediumDensity() {
Water coreWater = new Water(Pressure.FromPascals(101325), Temperature.FromKelvins(300));
GetCoolPropOriginal asd = new GetCoolPropOriginal();
GetCoolProp asdf = new GetCoolProp();
Pressure pressure = Pressure.FromPascals(101325);
Temperature temperature = Temperature.FromKelvins(300);
double actual = (CoolProp.PropsSI("D", "P", 101325, "T", 300, "Water"));
double actual2 = asd.GetDensity("P", 101325, "T", 300, "Water");
double actual3= asdf.GetDensity(pressure, temperature,"Water");
double expected = coreWater.ThermodynamicState.Density.KilogramsPerCubicMeter;
//double expected3 = coreWater.ThermodynamicState.Temperature.DegreesCelsius;
List<double> liste = new List<double>();
liste.Add(actual);
liste.Add(actual2);
liste.Add(actual3);
liste.Add(expected);
Boolean boola = true;
for (int i = 0; i < liste.Count-1; i++)
{
for (int j = i+1; j < liste.Count; j++)
{
if (!Precision.AlmostEqual(liste[i], liste[j], 0.01))
{
boola = false;
}
}
}
Assert.True(boola);
}
我的代码是工作。但我想在一行中测试我的流体密度和其他功能。我不想要每一个,因为我有很多功能。有没有办法测试这个代码,比如 (assert.true(precision.almostEqual(double,double,双,双,MaximumAbsoluteError)
饮歌长啸
米脂
相关分类