コード例 #1
0
        public void TestFlatPlanterSerialization()
        {
            var c = Catchment.Make("TestFlatPlanter",
                                   InfiltrationTestProcedure.OpenPit,
                                   PRStatus.Fail, 3.56m,
                                   HierarchyLevel.DischargeToRiverSlough,
                                   23456, 45, 56, 6, 8,
                                   FlatPlanter.Make(true, 4.89m, Configuration.ConfigB,
                                                    AboveGradeProperties.Make(234m, 8.9m,
                                                                              70m, 0.23m, 6.7m, 5.34m,
                                                                              4.5m, 9.0m, 7.6m),
                                                    BelowGradeProperties.Make(0.76m, 87.5m,
                                                                              5.2m, 223.4m, 6m, 0.83m,
                                                                              Orifice.Make(1.6m))));
            var scenario = Scenario.Make("sloped", c, DateTime.UtcNow, ExpectedResult.Empty);

            using (var sw = new StringWriter())
                using (var xwrtr = XmlWriter.Create(sw))
                {
                    var ser = new XmlSerializer(typeof(Scenario));
                    ser.Serialize(xwrtr, scenario);
                    var s = sw.ToString();
                    Assert.IsNotNull(s);
                }
        }
コード例 #2
0
ファイル: EngineTester.cs プロジェクト: cbretanaz/StormWater
 private static Catchment MakeFlatPlanterCatchment(
     decimal blndSoilDepth, InfiltrationTestProcedure ift,
     decimal natInfRate, HierarchyLevel lvl, Configuration cfg,
     decimal impArea, int preCN, int postCn,
     int preTC, int postTC, decimal infPcnt, decimal botArea, decimal botWidth,
     decimal botPerimeter, decimal ss, decimal freeBrd, decimal ovflHgt,
     decimal ovflSA, decimal ovflEHgt, decimal ovflESA, decimal rockBotArea,
     decimal rockStrgDepth, decimal rockWidth, decimal porosity,
     decimal belowPipeStrgDepth, decimal?orificeDiameter, OrificeReason rsn)
 {
     return(Catchment.Make("FlatPlanterTestCatchment",
                           ift, PRStatus.Pass, natInfRate,
                           lvl, impArea, preCN, postCn, preTC, postTC,
                           FlatPlanter.Make(true, blndSoilDepth, cfg,
                                            AboveGradeProperties.Make(botArea,
                                                                      botWidth, botPerimeter, ss, freeBrd,
                                                                      ovflHgt, ovflSA,
                                                                      ovflEHgt, ovflESA),
                                            BelowGradeProperties.Make(infPcnt, rockBotArea,
                                                                      rockStrgDepth, rockWidth, porosity, belowPipeStrgDepth,
                                                                      orificeDiameter.HasValue?
                                                                      Orifice.Make(orificeDiameter.Value):
                                                                      Orifice.Make(rsn)))));
 }