gpt4 book ai didi

c# - UnitTesting非返回方法c#

转载 作者:太空宇宙 更新时间:2023-11-03 10:45:17 25 4
gpt4 key购买 nike

<分区>

如何对这样的方法进行单元测试?如果它是空的,它甚至有可能吗?

public static void CalcDeltaCO2 ()
{
double plantCO2usage = CalcPlantCO2Usage ();
double airShiftsPerHour = 1 + instance._greenhouse.WindowRoof.GetStatus ();
double co2AtStart = _simulatedChunks > 1 ? Toolbox.PPMtoM3perM3 (instance._currentCO2Sensor) : Toolbox.CO2_LEVEL_OUTSIDE;
instance._deltaCO2 = Toolbox.M3perM3toPPM ((((instance._greenhouse.CO2Dispenser.GetFlow ()) - plantCO2usage
/ (airShiftsPerHour * instance._greenhouse.Volume))
* (1.0 - (1.0 / Math.Pow (Math.E, (airShiftsPerHour * Toolbox.CHUNK_TIME_H)))) + (Toolbox.CO2_LEVEL_OUTSIDE - co2AtStart)
* (1.0 / Math.Pow (Math.E, (airShiftsPerHour * Toolbox.CHUNK_TIME_H))) + co2AtStart)
- Toolbox.PPMtoM3perM3 (instance._currentCO2Sensor));
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com