public void ShouldReturnCorrectWeightOfAllMaterialsInVessel() { Vessel vessel = new Vessel(); List <Material> materials = new List <Material>() { new Material { ActualWeight = 11 }, new Material { ActualWeight = 22 }, new Material { ActualWeight = 33 }, new Material { ActualWeight = 44 }, new Material { ActualWeight = 55 }, new Material { ActualWeight = 66 } }; vessel.Materials.AddRange(materials); double totalWeights = BatchHelperMethods.CountActualWeightOfAllMaterialsInVessel(vessel); Assert.AreEqual(231, totalWeights); }
private Material CalculateWaterDetails(string nameOfMaterial, BatchReport report) { Vessel mainMixer = report.AllVessels.Where(x => x.VesselType == Vessel.VesselTypes.MainMixer).FirstOrDefault(); double totalWeightsOfMaterials = BatchHelperMethods.CountActualWeightOfAllMaterialsInVessel(mainMixer); double totalVesselWeight = report.TotalActualWeight * 1000; double weightOfMissingWater = totalVesselWeight - totalWeightsOfMaterials; double rawMatTemp = nameOfMaterial == "Material 63" ? 80.0 : 20; double vesselTemp = nameOfMaterial == "Material 63" ? 77 : 44; DateTime StartTimeOfHCL = BatchHelperMethods.GetSingleMaterialFromVessel(report, "Material 59").StartTime; return(new Material { Name = nameOfMaterial, ActualWeight = weightOfMissingWater, StartTime = StartTimeOfHCL.Subtract(new TimeSpan(0, 0, 6, 0, 0)), AgitatorSpeed = 11, RawMatTemp = rawMatTemp, TargetWeight = weightOfMissingWater, WeighTime = 5, VesselTemp = vesselTemp, WaitTime = 0.1 }); }