public Rusle2JsonResponseToCsv(
     JsonHandler jsonHandler,
     Rusle2V5_0 serviceHandler,
     CsvHandler csvHandler)
 {
     this.jsonHandler    = jsonHandler;
     this.serviceHandler = serviceHandler;
     this.csvHandler     = csvHandler;
 }
示例#2
0
 public ErosionModelJsonResponseToErosionParameters(
     JsonHandler jsonHandler,
     WeppV3_1 weppV3_1Service,
     WepsV5_2 wepsV5_2Service,
     Rusle2V5_0 rusle2V5_0Service,
     CsvHandler csvHandler)
 {
     this.jsonHandler       = jsonHandler;
     this.weppV3_1Service   = weppV3_1Service;
     this.wepsV5_2Service   = wepsV5_2Service;
     this.rusle2V5_0Service = rusle2V5_0Service;
     this.csvHandler        = csvHandler;
 }
示例#3
0
        public void ParseResults_ValidJson_ExpectedResults()
        {
            // Arrange
            var    sut  = new Rusle2V5_0();
            string json = File.ReadAllText(
                @"Assets\exampleRusle2ResponseV5_0.json");

            // Act
            Rusle2ResponseV5_0 actual = sut.ParseResultsJson(json);

            // Assert
            Assert.Equal(0.188843446136428, actual.SCI);
            Assert.Equal("R2_GrainFallow_HeavyTillage", actual.RotationName);
            Assert.Equal("69abba4e-85b8-11ea-9468-2d456bab2f27", actual.Suid);
            Assert.Equal(0.680779736533603, actual.ER);
            Assert.Equal(0.011386138613861, actual.FO);
            Assert.Equal(0.120332608460407, actual.OM);
        }
        public List <Rusle2ResponseV5_0> ReadRusle2ResponseV5_0Files(
            string filePath,
            Rusle2V5_0 service)
        {
            string[] files = Directory.GetFiles(filePath, "*.json");

            List <Rusle2ResponseV5_0> results = new List <Rusle2ResponseV5_0>();

            foreach (var file in files)
            {
                string             json   = File.ReadAllText(file);
                Rusle2ResponseV5_0 result = service.ParseResultsJson(json);

                results.Add(result);
            }

            return(results);
        }