public void PitchedRoofTest_Constructor_Success() { var building = BuildingImplementation.CreateBuilding(); var pitchedRoof = new PitchedRoof(building, new MonopitchRoof(building, 45), new MonopitchRoof(building, 15)); Assert.IsNotNull(pitchedRoof, "PitchedRoof should be created."); Assert.AreEqual(45, pitchedRoof.LeftRoof.Slope, "Slope should be set at construction time."); Assert.AreEqual(15, pitchedRoof.RightRoof.Slope, "Slope should be set at construction time."); }
public void PitchedRoofTest_CalculateSnowLoad_Success() { var building = BuildingImplementation.CreateBuilding(); var pitchedRoof = new PitchedRoof(building, new MonopitchRoof(building, 45), new MonopitchRoof(building, 15)); pitchedRoof.CalculateSnowLoad(); Assert.AreEqual(0.36, Math.Round(pitchedRoof.LeftRoof.SnowLoadOnRoofValue, 3), "Snow load for left roof is not calculated properly."); Assert.AreEqual(0.72, Math.Round(pitchedRoof.RightRoof.SnowLoadOnRoofValue, 3), "Snow load for right roof is not calculated properly."); }
public void ExampleTest1_CalculateSnowLoad_Success() { var buildingSite = new BuildingSite(Zones.FirstZone, Topographies.Normal, 127); buildingSite.CalculateExposureCoefficient(); var snowLoad = new SnowLoad(buildingSite); snowLoad.CalculateSnowLoad(); var building = new Building(snowLoad); building.CalculateThermalCoefficient(); var pitchedRoof = new PitchedRoof(building, 35, 5); pitchedRoof.CalculateSnowLoad(); Assert.AreEqual(0.467, Math.Round(pitchedRoof.LeftRoof.SnowLoadOnRoofValue, 3), "Snow load for left roof is not calculated properly."); Assert.AreEqual(0.56, Math.Round(pitchedRoof.RightRoof.SnowLoadOnRoofValue, 3), "Snow load for right roof is not calculated properly."); }
public IResult Calculate() { BuildingSite buildingSite = GetBuildingSite(); SnowLoad snowLoad = GetSnowLoad(buildingSite); Building building = GetBuilding(snowLoad); PitchedRoof pitchedRoof = GetPitchedRoof(building); if (!ExposureCoefficient.HasValue) { buildingSite.CalculateExposureCoefficient(); } snowLoad.CalculateSnowLoad(); building.CalculateThermalCoefficient(); pitchedRoof.CalculateSnowLoad(); var result = new Result(); result.Properties.Add("C_e_", buildingSite.ExposureCoefficient); result.Properties.Add("s_k_", snowLoad.DefaultCharacteristicSnowLoad); result.Properties.Add("V", snowLoad.VariationCoefficient); result.Properties.Add("C_esl_", snowLoad.ExceptionalSnowLoadCoefficient); result.Properties.Add("s_n_", snowLoad.SnowLoadForSpecificReturnPeriod); result.Properties.Add("s_Ad_", snowLoad.DesignExceptionalSnowLoadForSpecificReturnPeriod); result.Properties.Add("t_i_", building.InternalTemperature); result.Properties.Add("∆_t_", building.TempreatureDifference); result.Properties.Add("U", building.OverallHeatTransferCoefficient); result.Properties.Add("C_t_", building.ThermalCoefficient); result.Properties.Add("μ_l,1_", pitchedRoof.LeftRoof.ShapeCoefficient); result.Properties.Add("μ_r,1_", pitchedRoof.RightRoof.ShapeCoefficient); result.Properties.Add("s_l,I_", pitchedRoof.LeftRoofCasesSnowLoad[1]); result.Properties.Add("s_r,I_", pitchedRoof.RightRoofCasesSnowLoad[1]); result.Properties.Add("s_l,II_", pitchedRoof.LeftRoofCasesSnowLoad[2]); result.Properties.Add("s_r,II_", pitchedRoof.RightRoofCasesSnowLoad[2]); result.Properties.Add("s_l,III_", pitchedRoof.LeftRoofCasesSnowLoad[3]); result.Properties.Add("s_r,III_", pitchedRoof.RightRoofCasesSnowLoad[3]); return(result); }
public SnowLoadPitchedRoof() { BuildingData = new BuildingData(); PitchedRoof = new PitchedRoof(BuildingData.Building, 0, 0); }